home *** CD-ROM | disk | FTP | other *** search
MacBinary | 1990-06-08 | 30.0 KB | [TEXT/MPS ] |
open in:
MacOS 8.1
|
Win98
|
DOS
browse contents |
view JSON data
|
view as text
This file was processed as: MacBinary
(archive/macBinary).
Confidence | Program | Detection | Match Type | Support
|
---|
66%
| dexvert
| Compact Compressed (Unix) (archive/compact)
| ext
| Supported |
10%
| dexvert
| MacBinary (archive/macBinary)
| fallback
| Supported |
1%
| dexvert
| Text File (text/txt)
| fallback
| Supported |
100%
| file
| MacBinary II, inited, Fri Jun 8 11:22:17 1990, modified Fri Jun 8 11:22:17 1990, creator 'MPS ', type ASCII, 29604 bytes "PrGeneralPlayPrint.c" , at 0x7424 826 bytes resource
| default (weak)
| |
99%
| file
| data
| default
| |
49%
| TrID
| Macintosh plain text (MacBinary)
| default
| |
33%
| TrID
| raw Group 3 FAX bitmap
| default (weak)
| |
16%
| TrID
| MacBinary 2
| default (weak)
| |
100%
| siegfried
| fmt/1762 MacBinary (II)
| default
| |
100%
| lsar
| MacBinary
| default
|
|
id metadata |
---|
key | value |
---|
macFileType | [TEXT] |
macFileCreator | [MPS ] |
hex view+--------+-------------------------+-------------------------+--------+--------+
|00000000| 00 14 50 72 47 65 6e 65 | 72 61 6c 50 6c 61 79 50 |..PrGene|ralPlayP|
|00000010| 72 69 6e 74 2e 63 00 00 | 00 00 00 00 00 00 00 00 |rint.c..|........|
|00000020| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000030| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000040| 00 54 45 58 54 4d 50 53 | 20 01 00 00 00 01 00 00 |.TEXTMPS| .......|
|00000050| 00 00 00 00 00 73 a4 00 | 00 03 3a a2 95 73 29 a2 |.....s..|..:..s).|
|00000060| 95 73 29 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |.s).....|........|
|00000070| 00 00 00 00 00 00 00 00 | 00 00 81 81 b2 a0 00 00 |........|........|
|00000080| 2f 2a 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |/*------|--------|
|00000090| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|000000a0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|000000b0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|000000c0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|000000d0| 0d 23 0d 23 09 50 72 47 | 65 6e 65 72 61 6c 50 6c |.#.#.PrG|eneralPl|
|000000e0| 61 79 50 72 69 6e 74 2e | 63 0d 23 0d 23 20 20 20 |ayPrint.|c.#.# |
|000000f0| 54 68 69 73 20 66 69 6c | 65 20 63 6f 6e 74 61 69 |This fil|e contai|
|00000100| 6e 73 20 61 6c 6c 20 6f | 66 20 74 68 65 20 66 75 |ns all o|f the fu|
|00000110| 6e 63 74 69 6f 6e 73 20 | 74 68 61 74 20 61 72 65 |nctions |that are|
|00000120| 20 75 73 65 64 20 61 74 | 20 70 72 69 6e 74 20 74 | used at| print t|
|00000130| 69 6d 65 20 61 6e 64 20 | 74 68 65 20 0d 23 20 20 |ime and |the .# |
|00000140| 20 63 61 6c 6c 73 20 74 | 6f 20 73 65 74 20 74 68 | calls t|o set th|
|00000150| 65 20 72 65 71 75 65 73 | 74 65 64 20 50 72 47 65 |e reques|ted PrGe|
|00000160| 6e 65 72 61 6c 20 6f 70 | 63 6f 64 65 73 20 73 65 |neral op|codes se|
|00000170| 6c 65 63 74 65 64 20 62 | 79 20 74 68 65 20 75 73 |lected b|y the us|
|00000180| 65 72 20 76 69 61 20 74 | 68 65 20 0d 23 09 50 72 |er via t|he .#.Pr|
|00000190| 47 65 6e 65 72 61 6c 20 | 6d 65 6e 75 2e 0d 23 20 |General |menu..# |
|000001a0| 20 20 0d 23 09 57 65 20 | 77 69 6c 6c 20 74 65 73 | .#.We |will tes|
|000001b0| 74 20 66 6f 72 20 74 68 | 65 20 70 72 65 73 65 6e |t for th|e presen|
|000001c0| 63 65 20 6f 66 20 50 72 | 47 65 6e 65 72 61 6c 20 |ce of Pr|General |
|000001d0| 61 74 20 69 6e 69 74 20 | 74 69 6d 65 20 61 6e 64 |at init |time and|
|000001e0| 20 61 6e 79 20 74 69 6d | 65 20 74 68 65 20 75 73 | any tim|e the us|
|000001f0| 65 72 0d 23 09 63 68 61 | 6e 67 65 73 20 74 68 65 |er.#.cha|nges the|
|00000200| 20 70 72 69 6e 74 65 72 | 20 64 72 69 76 65 72 2e | printer| driver.|
|00000210| 20 20 49 66 20 50 72 47 | 65 6e 65 72 61 6c 20 69 | If PrG|eneral i|
|00000220| 73 20 4e 4f 54 20 61 76 | 61 69 6c 61 62 6c 65 20 |s NOT av|ailable |
|00000230| 66 6f 72 20 74 68 65 20 | 63 75 72 72 65 6e 74 20 |for the |current |
|00000240| 0d 23 09 70 72 69 6e 74 | 65 72 20 64 72 69 76 65 |.#.print|er drive|
|00000250| 72 2c 20 74 68 65 20 70 | 72 69 6e 74 65 72 20 64 |r, the p|rinter d|
|00000260| 72 69 76 65 72 20 77 69 | 6c 6c 20 72 65 74 75 72 |river wi|ll retur|
|00000270| 6e 20 72 65 73 4e 6f 74 | 46 6f 75 6e 64 20 69 6e |n resNot|Found in|
|00000280| 20 50 72 45 72 72 6f 72 | 2e 20 57 65 20 0d 23 20 | PrError|. We .# |
|00000290| 20 20 77 69 6c 6c 20 64 | 69 73 61 62 6c 65 20 74 | will d|isable t|
|000002a0| 68 65 20 50 72 47 65 6e | 65 72 61 6c 20 6d 65 6e |he PrGen|eral men|
|000002b0| 75 20 61 6e 64 20 63 61 | 6c 6c 20 50 72 53 65 74 |u and ca|ll PrSet|
|000002c0| 45 72 72 6f 72 28 30 29 | 2c 20 77 68 69 63 68 20 |Error(0)|, which |
|000002d0| 77 69 6c 6c 20 72 65 6d | 6f 76 65 20 74 68 65 20 |will rem|ove the |
|000002e0| 0d 23 09 72 65 73 4e 6f | 74 66 6f 75 6e 64 20 65 |.#.resNo|tfound e|
|000002f0| 72 72 6f 72 20 61 6e 64 | 20 61 6c 6c 6f 77 20 50 |rror and| allow P|
|00000300| 72 47 65 6e 65 72 61 6c | 50 6c 61 79 20 74 6f 20 |rGeneral|Play to |
|00000310| 70 72 69 6e 74 20 77 69 | 74 68 6f 75 74 20 75 73 |print wi|thout us|
|00000320| 69 6e 67 20 50 72 47 65 | 6e 65 72 61 6c 27 73 0d |ing PrGe|neral's.|
|00000330| 23 09 6f 70 63 6f 64 65 | 73 2e 20 20 57 65 20 77 |#.opcode|s. We w|
|00000340| 69 6c 6c 20 73 65 74 20 | 74 68 65 20 67 50 72 47 |ill set |the gPrG|
|00000350| 65 6e 65 72 61 6c 4c 69 | 76 65 73 20 66 6c 61 67 |eneralLi|ves flag|
|00000360| 20 74 6f 20 66 61 6c 73 | 65 20 77 68 69 63 68 20 | to fals|e which |
|00000370| 77 69 6c 6c 20 70 72 65 | 76 65 6e 74 20 75 73 0d |will pre|vent us.|
|00000380| 23 20 20 20 66 72 6f 6d | 20 63 61 6c 6c 69 6e 67 |# from| calling|
|00000390| 20 61 6e 79 20 6f 66 20 | 50 72 47 65 6e 65 72 61 | any of |PrGenera|
|000003a0| 6c 27 73 20 6f 70 63 6f | 64 65 73 2e 0d 23 0d 23 |l's opco|des..#.#|
|000003b0| 09 57 65 20 61 73 73 75 | 6d 65 20 74 68 61 74 20 |.We assu|me that |
|000003c0| 61 6c 6c 20 6f 66 20 50 | 72 47 65 6e 65 72 61 6c |all of P|rGeneral|
|000003d0| 27 73 20 6f 70 63 6f 64 | 65 73 20 61 72 65 20 73 |'s opcod|es are s|
|000003e0| 75 70 70 6f 72 74 65 64 | 20 62 79 20 74 68 65 20 |upported| by the |
|000003f0| 63 75 72 72 65 6e 74 20 | 70 72 69 6e 74 65 72 0d |current |printer.|
|00000400| 23 09 64 72 69 76 65 72 | 20 75 6e 74 69 6c 20 77 |#.driver| until w|
|00000410| 65 20 64 65 74 65 72 6d | 69 6e 65 20 6f 74 68 65 |e determ|ine othe|
|00000420| 72 77 69 73 65 2e 20 20 | 49 66 20 77 65 20 74 72 |rwise. |If we tr|
|00000430| 79 20 74 6f 20 75 73 65 | 20 61 6e 20 75 6e 73 75 |y to use| an unsu|
|00000440| 70 70 6f 72 74 65 64 20 | 6f 70 63 6f 64 65 2c 20 |pported |opcode, |
|00000450| 0d 23 09 50 72 47 65 6e | 65 72 61 6c 20 77 69 6c |.#.PrGen|eral wil|
|00000460| 6c 20 73 65 74 20 69 45 | 72 72 6f 72 20 74 6f 20 |l set iE|rror to |
|00000470| 4f 70 4e 6f 74 49 6d 70 | 6c 2e 20 20 57 65 20 77 |OpNotImp|l. We w|
|00000480| 69 6c 6c 20 74 68 65 6e | 20 73 65 74 20 6f 6e 65 |ill then| set one|
|00000490| 20 6f 66 20 74 68 65 20 | 61 70 70 72 6f 70 72 69 | of the |appropri|
|000004a0| 61 74 65 20 0d 23 09 66 | 6c 61 67 73 20 28 67 4c |ate .#.f|lags (gL|
|000004b0| 61 6e 64 73 63 61 70 65 | 4f 70 49 6d 70 6c 2c 20 |andscape|OpImpl, |
|000004c0| 67 44 72 61 66 74 42 69 | 74 73 4f 70 49 6d 70 6c |gDraftBi|tsOpImpl|
|000004d0| 2c 6f 72 20 67 53 65 74 | 52 73 6c 4f 70 49 6d 70 |,or gSet|RslOpImp|
|000004e0| 6c 29 20 74 6f 20 22 66 | 61 6c 73 65 22 20 74 6f |l) to "f|alse" to|
|000004f0| 20 70 72 65 76 65 6e 74 | 20 0d 23 09 63 6f 6e 74 | prevent| .#.cont|
|00000500| 69 6e 75 65 64 20 75 73 | 65 20 6f 66 20 74 68 69 |inued us|e of thi|
|00000510| 73 20 6f 70 63 6f 64 65 | 20 61 6e 64 20 61 64 6a |s opcode| and adj|
|00000520| 75 73 74 20 74 68 65 20 | 50 72 47 65 6e 65 72 61 |ust the |PrGenera|
|00000530| 6c 20 6d 65 6e 75 20 61 | 70 70 72 6f 70 72 69 61 |l menu a|ppropria|
|00000540| 74 65 6c 79 2e 20 20 54 | 68 65 73 65 20 0d 23 20 |tely. T|hese .# |
|00000550| 09 66 6c 61 67 73 20 77 | 69 6c 6c 20 62 65 20 72 |.flags w|ill be r|
|00000560| 65 73 65 74 2c 20 69 66 | 20 74 68 65 20 75 73 65 |eset, if| the use|
|00000570| 72 20 73 65 6c 65 63 74 | 73 20 61 20 6e 65 77 20 |r select|s a new |
|00000580| 70 72 69 6e 74 65 72 20 | 64 72 69 76 65 72 2e 0d |printer |driver..|
|00000590| 23 0d 23 20 20 20 49 66 | 20 74 68 65 20 22 68 69 |#.# If| the "hi|
|000005a0| 67 68 20 72 65 73 6f 6c | 75 74 69 6f 6e 20 70 72 |gh resol|ution pr|
|000005b0| 69 6e 74 69 6e 67 22 20 | 6d 65 6e 75 20 69 74 65 |inting" |menu ite|
|000005c0| 6d 20 69 73 20 73 65 6c | 65 63 74 65 64 2c 20 77 |m is sel|ected, w|
|000005d0| 65 20 75 73 65 20 74 68 | 65 20 47 65 74 52 73 6c |e use th|e GetRsl|
|000005e0| 44 61 74 61 0d 23 09 6f | 70 63 6f 64 65 20 74 6f |Data.#.o|pcode to|
|000005f0| 20 64 65 74 65 72 6d 69 | 6e 65 20 74 68 65 20 68 | determi|ne the h|
|00000600| 69 67 68 65 73 74 20 22 | 73 71 75 61 72 65 22 20 |ighest "|square" |
|00000610| 72 65 73 6f 6c 75 74 69 | 6f 6e 20 74 68 61 74 20 |resoluti|on that |
|00000620| 69 73 20 73 75 70 70 6f | 72 74 65 64 20 62 79 20 |is suppo|rted by |
|00000630| 74 68 65 20 0d 23 09 63 | 75 72 72 65 6e 74 20 70 |the .#.c|urrent p|
|00000640| 72 69 6e 74 65 72 20 64 | 72 69 76 65 72 2e 20 20 |rinter d|river. |
|00000650| 42 65 66 6f 72 65 20 77 | 65 20 63 61 6c 6c 20 53 |Before w|e call S|
|00000660| 65 74 52 73 6c 20 74 6f | 20 73 65 74 20 74 68 65 |etRsl to| set the|
|00000670| 73 65 20 6e 65 77 20 72 | 65 73 6f 6c 75 74 69 6f |se new r|esolutio|
|00000680| 6e 73 2c 20 0d 23 20 09 | 77 65 20 77 69 6c 6c 20 |ns, .# .|we will |
|00000690| 73 61 76 65 20 74 68 65 | 20 6f 72 69 67 69 6e 61 |save the| origina|
|000006a0| 6c 20 72 65 73 6f 6c 75 | 74 69 6f 6e 73 20 28 69 |l resolu|tions (i|
|000006b0| 6e 20 67 4f 72 69 67 69 | 6e 61 6c 69 56 52 65 73 |n gOrigi|naliVRes|
|000006c0| 20 61 6e 64 20 67 4f 72 | 69 67 69 6e 61 6c 69 48 | and gOr|iginaliH|
|000006d0| 52 65 73 29 0d 23 20 20 | 20 77 68 69 63 68 20 77 |Res).# | which w|
|000006e0| 69 6c 6c 20 65 6e 61 62 | 6c 65 20 75 73 20 74 6f |ill enab|le us to|
|000006f0| 20 72 65 73 65 74 20 74 | 68 65 20 72 65 73 6f 6c | reset t|he resol|
|00000700| 75 74 69 6f 6e 73 20 74 | 6f 20 74 68 65 69 72 20 |utions t|o their |
|00000710| 6f 72 69 67 69 6e 61 6c | 20 73 65 74 74 69 6e 67 |original| setting|
|00000720| 73 2c 20 77 68 65 6e 0d | 23 20 09 74 68 65 20 75 |s, when.|# .the u|
|00000730| 73 65 72 20 74 75 72 6e | 73 20 22 6f 66 66 22 20 |ser turn|s "off" |
|00000740| 74 68 69 73 20 6d 65 6e | 75 20 69 74 65 6d 2e 20 |this men|u item. |
|00000750| 0d 23 0d 23 20 20 20 57 | 68 65 6e 20 74 68 65 20 |.#.# W|hen the |
|00000760| 75 73 65 72 20 73 65 6c | 65 63 74 73 20 74 68 65 |user sel|ects the|
|00000770| 20 22 66 6f 72 63 65 64 | 20 64 72 61 66 74 20 6d | "forced| draft m|
|00000780| 6f 64 65 20 70 72 69 6e | 74 69 6e 67 22 20 6d 65 |ode prin|ting" me|
|00000790| 6e 75 20 69 74 65 6d 2c | 20 77 65 20 77 69 6c 6c |nu item,| we will|
|000007a0| 20 63 72 65 61 74 65 20 | 0d 23 09 61 6e 20 6f 66 | create |.#.an of|
|000007b0| 66 2d 73 63 72 65 65 6e | 20 77 6f 72 6c 64 2c 20 |f-screen| world, |
|000007c0| 63 61 6c 6c 20 64 72 61 | 77 53 74 75 66 66 20 74 |call dra|wStuff t|
|000007d0| 6f 20 64 72 61 77 20 6f | 75 72 20 67 72 61 70 68 |o draw o|ur graph|
|000007e0| 20 69 6e 74 6f 20 69 74 | 2c 20 61 6e 64 20 43 6f | into it|, and Co|
|000007f0| 70 79 42 69 74 73 20 74 | 68 65 20 0d 23 09 63 6f |pyBits t|he .#.co|
|00000800| 6e 74 65 6e 74 73 20 69 | 6e 74 6f 20 74 68 65 20 |ntents i|nto the |
|00000810| 70 72 69 6e 74 65 72 27 | 73 20 47 72 61 66 50 6f |printer'|s GrafPo|
|00000820| 72 74 2e 20 20 54 68 69 | 73 20 77 69 6c 6c 20 65 |rt. Thi|s will e|
|00000830| 6e 73 75 72 65 20 74 68 | 61 74 20 67 72 61 70 68 |nsure th|at graph|
|00000840| 20 77 69 6c 6c 20 70 72 | 69 6e 74 20 69 6e 20 0d | will pr|int in .|
|00000850| 23 09 22 64 72 61 66 74 | 22 20 6d 6f 64 65 2e 20 |#."draft|" mode. |
|00000860| 20 52 65 6d 65 6d 62 65 | 72 2c 20 77 68 65 6e 20 | Remembe|r, when |
|00000870| 74 68 65 20 44 72 61 66 | 74 42 69 74 73 20 6f 70 |the Draf|tBits op|
|00000880| 63 6f 64 65 20 69 73 20 | 75 73 65 64 2c 20 79 6f |code is |used, yo|
|00000890| 75 20 77 69 6c 6c 20 6f | 6e 6c 79 20 62 65 20 61 |u will o|nly be a|
|000008a0| 62 6c 65 20 0d 23 09 74 | 6f 20 70 72 69 6e 74 20 |ble .#.t|o print |
|000008b0| 74 65 78 74 2c 20 62 69 | 74 6d 61 70 73 2c 20 61 |text, bi|tmaps, a|
|000008c0| 6e 64 20 70 69 78 6d 61 | 70 73 2e 20 20 0d 23 0d |nd pixma|ps. .#.|
|000008d0| 23 09 57 68 65 6e 20 74 | 68 65 20 22 66 6f 72 63 |#.When t|he "forc|
|000008e0| 65 64 20 64 72 61 66 74 | 20 6d 6f 64 65 20 70 72 |ed draft| mode pr|
|000008f0| 69 6e 74 69 6e 67 22 20 | 6d 65 6e 75 20 69 74 65 |inting" |menu ite|
|00000900| 6d 20 69 73 20 74 75 72 | 6e 65 64 20 22 6f 66 66 |m is tur|ned "off|
|00000910| 22 2c 20 77 65 20 75 73 | 65 20 74 68 65 20 0d 23 |", we us|e the .#|
|00000920| 09 4e 6f 44 72 61 66 74 | 42 69 74 73 20 6f 70 63 |.NoDraft|Bits opc|
|00000930| 6f 64 65 20 74 6f 20 74 | 75 72 6e 65 64 20 6f 66 |ode to t|urned of|
|00000940| 66 20 74 68 65 20 65 66 | 66 65 63 74 73 20 6f 66 |f the ef|fects of|
|00000950| 20 74 68 65 20 44 72 61 | 66 74 42 69 74 73 20 6f | the Dra|ftBits o|
|00000960| 70 63 6f 64 65 2e 0d 23 | 0d 23 20 20 20 49 66 20 |pcode..#|.# If |
|00000970| 74 68 65 20 75 73 65 72 | 20 68 61 73 20 73 65 6c |the user| has sel|
|00000980| 65 63 74 65 64 20 74 68 | 65 20 22 63 68 65 63 6b |ected th|e "check|
|00000990| 20 66 6f 72 20 6c 61 6e | 64 73 63 61 70 65 20 6f | for lan|dscape o|
|000009a0| 72 69 65 6e 74 61 74 69 | 6f 6e 22 20 6d 65 6e 75 |rientati|on" menu|
|000009b0| 20 69 74 65 6d 2c 20 77 | 65 20 77 69 6c 6c 0d 23 | item, w|e will.#|
|000009c0| 20 20 20 63 68 65 63 6b | 20 74 6f 20 64 65 74 65 | check| to dete|
|000009d0| 72 6d 69 6e 65 2c 20 69 | 66 20 74 68 65 20 6c 61 |rmine, i|f the la|
|000009e0| 6e 64 73 63 61 70 65 20 | 6f 72 69 65 6e 74 61 74 |ndscape |orientat|
|000009f0| 69 6f 6e 20 77 61 73 20 | 73 65 6c 65 63 74 65 64 |ion was |selected|
|00000a00| 20 69 6e 20 74 68 65 20 | 73 74 6c 79 65 20 64 69 | in the |stlye di|
|00000a10| 61 6c 6f 67 2e 20 20 0d | 23 09 57 65 20 77 69 6c |alog. .|#.We wil|
|00000a20| 6c 20 70 72 65 73 65 6e | 74 20 74 68 65 20 72 65 |l presen|t the re|
|00000a30| 73 75 6c 74 73 20 6f 66 | 20 74 68 65 20 6c 61 6e |sults of| the lan|
|00000a40| 64 73 63 61 70 65 20 6f | 72 69 65 6e 74 61 74 69 |dscape o|rientati|
|00000a50| 6f 6e 20 63 68 65 63 6b | 20 28 47 65 74 52 6f 74 |on check| (GetRot|
|00000a60| 6e 20 6f 70 63 6f 64 65 | 29 20 0d 23 20 20 20 76 |n opcode|) .# v|
|00000a70| 69 61 20 61 20 64 69 61 | 6c 6f 67 2e 20 20 57 65 |ia a dia|log. We|
|00000a80| 20 77 69 6c 6c 20 6f 6e | 6c 79 20 63 68 65 63 6b | will on|ly check|
|00000a90| 20 66 6f 72 20 6c 61 6e | 64 73 63 61 70 65 20 6f | for lan|dscape o|
|00000aa0| 72 69 65 6e 74 61 74 69 | 6f 6e 20 61 66 74 65 72 |rientati|on after|
|00000ab0| 20 74 68 65 20 75 73 65 | 72 20 63 61 6c 6c 73 20 | the use|r calls |
|00000ac0| 0d 23 20 20 20 74 68 65 | 20 50 61 67 65 20 53 65 |.# the| Page Se|
|00000ad0| 74 75 70 20 64 69 61 6c | 6f 67 2e 0d 23 20 20 20 |tup dial|og..# |
|00000ae0| 0d 23 09 49 66 20 61 6e | 79 20 70 72 69 6e 74 20 |.#.If an|y print |
|00000af0| 65 72 72 6f 72 20 6f 63 | 63 75 72 73 20 64 75 72 |error oc|curs dur|
|00000b00| 69 6e 67 20 70 72 69 6e | 74 20 74 69 6d 65 2c 20 |ing prin|t time, |
|00000b10| 77 65 20 77 69 6c 6c 20 | 63 61 6c 6c 20 74 68 65 |we will |call the|
|00000b20| 20 41 6c 65 72 74 55 73 | 65 72 0d 23 09 66 75 6e | AlertUs|er.#.fun|
|00000b30| 63 74 69 6f 6e 2e 20 20 | 54 68 69 73 20 66 75 6e |ction. |This fun|
|00000b40| 63 74 69 6f 6e 20 77 69 | 6c 6c 20 64 69 73 70 6c |ction wi|ll displ|
|00000b50| 61 79 20 61 6e 20 61 6c | 65 72 74 20 74 6f 20 74 |ay an al|ert to t|
|00000b60| 65 6c 6c 20 74 68 65 20 | 75 73 65 72 20 74 68 61 |ell the |user tha|
|00000b70| 74 20 61 6e 0d 23 09 65 | 72 72 6f 72 20 6f 63 63 |t an.#.e|rror occ|
|00000b80| 75 72 72 65 64 2e 20 20 | 54 68 69 73 20 66 75 6e |urred. |This fun|
|00000b90| 63 74 69 6f 6e 20 69 73 | 20 4e 4f 54 20 68 6f 77 |ction is| NOT how|
|00000ba0| 20 61 20 22 72 65 61 6c | 22 20 61 70 70 6c 69 63 | a "real|" applic|
|00000bb0| 61 74 69 6f 6e 20 73 68 | 6f 75 6c 64 20 0d 23 20 |ation sh|ould .# |
|00000bc0| 20 20 68 61 6e 64 6c 65 | 20 70 72 69 6e 74 69 6e | handle| printin|
|00000bd0| 67 20 65 72 72 6f 72 73 | 2c 20 62 75 74 20 69 74 |g errors|, but it|
|00000be0| 20 69 73 20 74 68 65 20 | 73 69 6d 70 6c 65 73 74 | is the |simplest|
|00000bf0| 20 61 70 70 72 6f 61 63 | 68 20 70 6f 73 73 69 62 | approac|h possib|
|00000c00| 6c 65 20 66 6f 72 20 74 | 68 69 73 0d 23 09 74 79 |le for t|his.#.ty|
|00000c10| 70 65 20 6f 66 20 61 70 | 70 6c 69 63 61 74 69 6f |pe of ap|plicatio|
|00000c20| 6e 2e 20 20 4f 75 72 20 | 69 6e 74 65 6e 74 20 69 |n. Our |intent i|
|00000c30| 73 20 74 6f 20 64 65 6d | 6f 6e 73 74 72 61 74 65 |s to dem|onstrate|
|00000c40| 20 74 68 65 20 75 73 65 | 20 6f 66 20 50 72 47 65 | the use| of PrGe|
|00000c50| 6e 65 72 61 6c 2c 20 0d | 23 09 6e 6f 74 20 74 6f |neral, .|#.not to|
|00000c60| 20 63 72 65 61 74 65 20 | 61 20 66 75 6c 6c 20 66 | create |a full f|
|00000c70| 65 61 74 75 72 65 64 20 | 61 70 70 6c 69 63 61 74 |eatured |applicat|
|00000c80| 69 6f 6e 2e 20 20 54 65 | 63 68 20 4e 6f 74 65 20 |ion. Te|ch Note |
|00000c90| 23 31 36 31 20 63 6f 6e | 74 61 69 6e 73 20 61 6e |#161 con|tains an|
|00000ca0| 0d 23 20 20 20 69 6e 64 | 75 73 74 72 69 61 6c 20 |.# ind|ustrial |
|00000cb0| 73 74 72 65 6e 67 74 68 | 20 66 75 6c 6c 20 66 65 |strength| full fe|
|00000cc0| 61 74 75 72 65 64 20 70 | 72 69 6e 74 69 6e 67 20 |atured p|rinting |
|00000cd0| 6c 6f 6f 70 2e 0d 23 0d | 23 20 2d 2d 2d 2d 2d 2d |loop..#.|# ------|
|00000ce0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00000cf0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00000d00| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00000d10| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00000d20| 2d 2d 2d 2d 2d 2d 2d 2d | 20 20 0d 23 0d 23 09 56 |--------| .#.#.V|
|00000d30| 65 72 73 69 6f 6e 73 3a | 20 20 20 31 2e 30 30 09 |ersions:| 1.00.|
|00000d40| 09 09 09 20 20 20 20 4a | 75 6e 65 20 31 2c 20 31 |... J|une 1, 1|
|00000d50| 39 39 30 0d 23 0d 23 09 | 43 6f 6d 70 6f 6e 65 6e |990.#.#.|Componen|
|00000d60| 74 73 3a 20 50 72 47 65 | 6e 65 72 61 6c 50 6c 61 |ts: PrGe|neralPla|
|00000d70| 79 2e 63 09 09 09 4a 75 | 6e 65 20 31 2c 20 31 39 |y.c...Ju|ne 1, 19|
|00000d80| 39 30 0d 23 09 09 09 09 | 50 72 47 65 6e 65 72 61 |90.#....|PrGenera|
|00000d90| 6c 50 6c 61 79 50 72 69 | 6e 74 2e 63 09 4a 75 6e |lPlayPri|nt.c.Jun|
|00000da0| 65 20 31 2c 20 31 39 39 | 30 0d 23 09 09 09 09 50 |e 1, 199|0.#....P|
|00000db0| 72 47 65 6e 65 72 61 6c | 50 6c 61 79 2e 68 09 09 |rGeneral|Play.h..|
|00000dc0| 09 4a 75 6e 65 20 31 2c | 20 31 39 39 30 0d 23 09 |.June 1,| 1990.#.|
|00000dd0| 09 09 09 50 72 47 65 6e | 65 72 61 6c 50 6c 61 79 |...PrGen|eralPlay|
|00000de0| 2e 72 09 09 09 4a 75 6e | 65 20 31 2c 20 31 39 39 |.r...Jun|e 1, 199|
|00000df0| 30 0d 23 0d 23 0d 23 09 | 41 70 70 6c 65 20 4d 61 |0.#.#.#.|Apple Ma|
|00000e00| 63 69 6e 74 6f 73 68 20 | 44 65 76 65 6c 6f 70 65 |cintosh |Develope|
|00000e10| 72 20 54 65 63 68 6e 69 | 63 61 6c 20 53 75 70 70 |r Techni|cal Supp|
|00000e20| 6f 72 74 0d 23 09 43 6f | 70 79 72 69 67 68 74 20 |ort.#.Co|pyright |
|00000e30| a9 20 31 39 39 30 20 41 | 70 70 6c 65 20 43 6f 6d |. 1990 A|pple Com|
|00000e40| 70 75 74 65 72 2c 20 49 | 6e 63 2e 0d 23 09 41 6c |puter, I|nc..#.Al|
|00000e50| 6c 20 72 69 67 68 74 73 | 20 72 65 73 65 72 76 65 |l rights| reserve|
|00000e60| 64 2e 0d 23 0d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |d..#.---|--------|
|00000e70| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00000e80| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00000e90| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00000ea0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00000eb0| 2d 2d 2d 2a 2f 0d 0d 23 | 69 6e 63 6c 75 64 65 20 |---*/..#|include |
|00000ec0| 3c 45 72 72 6f 72 73 2e | 68 3e 0d 23 69 6e 63 6c |<Errors.|h>.#incl|
|00000ed0| 75 64 65 20 3c 54 79 70 | 65 73 2e 68 3e 0d 23 69 |ude <Typ|es.h>.#i|
|00000ee0| 6e 63 6c 75 64 65 20 3c | 52 65 73 6f 75 72 63 65 |nclude <|Resource|
|00000ef0| 73 2e 68 3e 0d 23 69 6e | 63 6c 75 64 65 20 3c 54 |s.h>.#in|clude <T|
|00000f00| 6f 6f 6c 55 74 69 6c 73 | 2e 68 3e 0d 23 69 6e 63 |oolUtils|.h>.#inc|
|00000f10| 6c 75 64 65 20 3c 51 75 | 69 63 6b 44 72 61 77 2e |lude <Qu|ickDraw.|
|00000f20| 68 3e 0d 23 69 6e 63 6c | 75 64 65 20 3c 51 44 4f |h>.#incl|ude <QDO|
|00000f30| 66 66 73 63 72 65 65 6e | 2e 68 3e 0d 23 69 6e 63 |ffscreen|.h>.#inc|
|00000f40| 6c 75 64 65 20 3c 46 6f | 6e 74 73 2e 68 3e 0d 23 |lude <Fo|nts.h>.#|
|00000f50| 69 6e 63 6c 75 64 65 20 | 3c 50 72 69 6e 74 69 6e |include |<Printin|
|00000f60| 67 2e 68 3e 0d 23 69 6e | 63 6c 75 64 65 20 3c 50 |g.h>.#in|clude <P|
|00000f70| 61 63 6b 61 67 65 73 2e | 68 3e 0d 23 69 6e 63 6c |ackages.|h>.#incl|
|00000f80| 75 64 65 20 3c 4d 65 6d | 6f 72 79 2e 68 3e 0d 23 |ude <Mem|ory.h>.#|
|00000f90| 69 6e 63 6c 75 64 65 20 | 3c 73 61 6e 65 2e 68 3e |include |<sane.h>|
|00000fa0| 0d 23 69 6e 63 6c 75 64 | 65 20 3c 50 72 47 65 6e |.#includ|e <PrGen|
|00000fb0| 65 72 61 6c 50 6c 61 79 | 2e 68 3e 0d 0d 2f 2f 20 |eralPlay|.h>..// |
|00000fc0| 20 54 68 65 20 66 6f 6c | 6c 6f 77 69 6e 67 20 65 | The fol|lowing e|
|00000fd0| 78 74 65 72 6e 20 67 6c | 6f 62 61 6c 73 20 61 72 |xtern gl|obals ar|
|00000fe0| 65 20 73 65 74 20 75 70 | 20 62 79 20 74 68 65 20 |e set up| by the |
|00000ff0| 49 6e 69 74 69 61 6c 69 | 7a 65 20 66 75 6e 63 74 |Initiali|ze funct|
|00001000| 69 6f 6e 20 69 6e 20 50 | 72 47 65 6e 65 72 61 6c |ion in P|rGeneral|
|00001010| 50 6c 61 79 2e 63 0d 0d | 65 78 74 65 72 6e 20 54 |Play.c..|extern T|
|00001020| 48 50 72 69 6e 74 09 09 | 09 67 50 72 52 65 63 48 |HPrint..|.gPrRecH|
|00001030| 64 6c 3b 0d 65 78 74 65 | 72 6e 20 42 6f 6f 6c 65 |dl;.exte|rn Boole|
|00001040| 61 6e 09 09 09 67 48 69 | 67 68 52 65 73 6f 6c 75 |an...gHi|ghResolu|
|00001050| 74 69 6f 6e 4f 4e 2c 20 | 20 0d 09 09 09 09 09 09 |tionON, | .......|
|00001060| 67 55 73 65 44 72 61 66 | 74 42 69 74 73 2c 0d 09 |gUseDraf|tBits,..|
|00001070| 09 09 09 09 09 67 43 68 | 65 63 6b 46 6f 72 4c 61 |.....gCh|eckForLa|
|00001080| 6e 64 73 63 61 70 65 2c | 0d 09 09 09 09 09 09 67 |ndscape,|.......g|
|00001090| 44 72 61 66 74 42 69 74 | 73 48 61 73 42 65 65 6e |DraftBit|sHasBeen|
|000010a0| 53 65 74 3b 0d 09 09 09 | 09 09 09 67 50 72 47 65 |Set;....|...gPrGe|
|000010b0| 6e 65 72 61 6c 4c 69 76 | 65 73 2c 0d 09 09 09 09 |neralLiv|es,.....|
|000010c0| 09 09 67 4c 61 6e 64 73 | 63 61 70 65 4f 70 49 6d |..gLands|capeOpIm|
|000010d0| 70 6c 2c 0d 09 09 09 09 | 09 09 67 44 72 61 66 74 |pl,.....|..gDraft|
|000010e0| 42 69 74 73 4f 70 49 6d | 70 6c 2c 0d 09 09 09 09 |BitsOpIm|pl,.....|
|000010f0| 09 09 67 53 65 74 52 73 | 6c 4f 70 49 6d 70 6c 3b |..gSetRs|lOpImpl;|
|00001100| 0d 0d 65 78 74 65 72 6e | 20 73 68 6f 72 74 09 09 |..extern| short..|
|00001110| 09 67 4f 72 69 67 69 6e | 61 6c 44 72 69 76 65 72 |.gOrigin|alDriver|
|00001120| 56 65 72 73 3b 0d 09 09 | 09 09 09 09 0d 73 68 6f |Vers;...|.....sho|
|00001130| 72 74 20 20 09 09 09 09 | 09 67 53 63 61 6c 65 20 |rt ....|.gScale |
|00001140| 3d 20 31 2c 0d 09 09 09 | 09 09 09 67 4d 61 78 44 |= 1,....|...gMaxD|
|00001150| 50 49 20 3d 20 30 2c 0d | 09 09 09 09 09 09 67 4f |PI = 0,.|......gO|
|00001160| 72 69 67 69 6e 61 6c 69 | 56 52 65 73 2c 0d 09 09 |riginali|VRes,...|
|00001170| 09 09 09 09 67 4f 72 69 | 67 69 6e 61 6c 69 48 52 |....gOri|ginaliHR|
|00001180| 65 73 3b 0d 0d 0d 76 6f | 69 64 20 6e 6f 50 72 47 |es;...vo|id noPrG|
|00001190| 65 6e 65 72 61 6c 41 6c | 65 72 74 20 28 20 76 6f |eneralAl|ert ( vo|
|000011a0| 69 64 20 29 3b 0d 42 6f | 6f 6c 65 61 6e 20 74 65 |id );.Bo|olean te|
|000011b0| 73 74 46 6f 72 50 72 47 | 65 6e 65 72 61 6c 20 28 |stForPrG|eneral (|
|000011c0| 20 76 6f 69 64 20 29 3b | 0d 76 6f 69 64 20 73 61 | void );|.void sa|
|000011d0| 76 65 52 65 73 6f 6c 75 | 74 69 6f 6e 20 28 20 76 |veResolu|tion ( v|
|000011e0| 6f 69 64 20 29 3b 0d 76 | 6f 69 64 20 72 65 73 65 |oid );.v|oid rese|
|000011f0| 74 53 65 74 52 73 6c 20 | 28 20 76 6f 69 64 20 29 |tSetRsl |( void )|
|00001200| 3b 0d 69 6e 74 20 73 65 | 74 4d 61 78 52 65 73 6f |;.int se|tMaxReso|
|00001210| 6c 75 74 69 6f 6e 20 28 | 20 76 6f 69 64 20 29 3b |lution (| void );|
|00001220| 0d 76 6f 69 64 20 64 6f | 53 65 74 52 73 6c 20 28 |.void do|SetRsl (|
|00001230| 20 76 6f 69 64 20 29 3b | 0d 76 6f 69 64 20 64 6f | void );|.void do|
|00001240| 44 72 61 66 74 42 69 74 | 73 20 28 20 76 6f 69 64 |DraftBit|s ( void|
|00001250| 20 29 3b 0d 76 6f 69 64 | 20 64 6f 4e 4f 44 72 61 | );.void| doNODra|
|00001260| 66 74 42 69 74 73 20 28 | 20 76 6f 69 64 20 29 3b |ftBits (| void );|
|00001270| 0d 76 6f 69 64 20 64 72 | 61 77 53 74 75 66 66 20 |.void dr|awStuff |
|00001280| 28 47 72 61 66 50 74 72 | 09 70 72 50 6f 72 74 2c |(GrafPtr|.prPort,|
|00001290| 20 73 68 6f 72 74 20 67 | 53 63 61 6c 65 29 3b 0d | short g|Scale);.|
|000012a0| 76 6f 69 64 20 63 6f 70 | 79 42 69 74 73 4d 79 47 |void cop|yBitsMyG|
|000012b0| 72 61 70 68 20 28 54 50 | 50 72 50 6f 72 74 20 70 |raph (TP|PrPort p|
|000012c0| 72 69 6e 74 50 6f 72 74 | 29 3b 0d 76 6f 69 64 20 |rintPort|);.void |
|000012d0| 63 6f 6d 70 61 72 65 50 | 72 69 6e 74 52 65 63 6f |compareP|rintReco|
|000012e0| 72 64 73 20 28 20 76 6f | 69 64 20 29 3b 0d 76 6f |rds ( vo|id );.vo|
|000012f0| 69 64 20 50 72 65 73 65 | 6e 74 53 74 79 6c 65 44 |id Prese|ntStyleD|
|00001300| 69 61 6c 6f 67 20 28 20 | 76 6f 69 64 20 29 3b 0d |ialog ( |void );.|
|00001310| 76 6f 69 64 20 50 72 69 | 6e 74 54 68 69 73 28 20 |void Pri|ntThis( |
|00001320| 76 6f 69 64 20 29 3b 0d | 0d 0d 2f 2f 2d 2d 2d 2d |void );.|..//----|
|00001330| 2d 2d 20 6e 6f 50 72 47 | 65 6e 65 72 61 6c 41 6c |-- noPrG|eneralAl|
|00001340| 65 72 74 20 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |ert ----|--------|
|00001350| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00001360| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00001370| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 0d |--------|-------.|
|00001380| 2f 2f 0d 2f 2f 20 20 44 | 69 73 70 6c 61 79 20 74 |//.// D|isplay t|
|00001390| 68 65 20 61 6c 65 72 74 | 20 74 68 61 74 20 74 65 |he alert| that te|
|000013a0| 6c 6c 73 20 74 68 65 20 | 75 73 65 72 20 74 68 61 |lls the |user tha|
|000013b0| 74 20 50 72 47 65 6e 65 | 72 61 6c 20 69 73 20 6e |t PrGene|ral is n|
|000013c0| 6f 74 20 61 76 61 69 6c | 61 62 6c 65 0d 2f 2f 20 |ot avail|able.// |
|000013d0| 20 66 6f 72 20 74 68 65 | 20 63 75 72 72 65 6e 74 | for the| current|
|000013e0| 6c 79 20 73 65 6c 65 63 | 74 65 64 20 70 72 69 6e |ly selec|ted prin|
|000013f0| 74 65 72 20 64 72 69 76 | 65 72 2e 2e 2e 0d 2f 2f |ter driv|er....//|
|00001400| 0d 0d 76 6f 69 64 20 6e | 6f 50 72 47 65 6e 65 72 |..void n|oPrGener|
|00001410| 61 6c 41 6c 65 72 74 20 | 28 29 0d 7b 0d 09 73 68 |alAlert |().{..sh|
|00001420| 6f 72 74 09 09 69 74 65 | 6d 48 69 74 3b 0d 0d 09 |ort..ite|mHit;...|
|00001430| 53 65 74 43 75 72 73 6f | 72 28 26 71 64 2e 61 72 |SetCurso|r(&qd.ar|
|00001440| 72 6f 77 29 3b 0d 09 0d | 09 69 74 65 6d 48 69 74 |row);...|.itemHit|
|00001450| 20 3d 20 4e 6f 74 65 41 | 6c 65 72 74 28 72 4e 4f | = NoteA|lert(rNO|
|00001460| 50 72 47 65 6e 65 72 61 | 6c 41 6c 65 72 74 2c 20 |PrGenera|lAlert, |
|00001470| 6e 69 6c 29 3b 0d 7d 20 | 20 2f 2f 20 20 65 6e 64 |nil);.} | // end|
|00001480| 20 6f 66 20 6e 6f 50 72 | 47 65 6e 65 72 61 6c 41 | of noPr|GeneralA|
|00001490| 6c 65 72 74 0d 0d 0d 0d | 0d 2f 2f 2d 2d 2d 2d 2d |lert....|.//-----|
|000014a0| 2d 20 74 65 73 74 46 6f | 72 50 72 47 65 6e 65 72 |- testFo|rPrGener|
|000014b0| 61 6c 20 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |al -----|--------|
|000014c0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|000014d0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|000014e0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 0d 2f |--------|------./|
|000014f0| 2f 0d 2f 2f 20 20 57 65 | 20 77 61 6e 74 20 74 6f |/.// We| want to|
|00001500| 20 64 65 74 65 72 6d 69 | 6e 65 20 69 66 20 50 72 | determi|ne if Pr|
|00001510| 47 65 6e 65 72 61 6c 20 | 69 73 20 61 76 61 69 6c |General |is avail|
|00001520| 61 62 6c 65 2e 20 20 49 | 66 20 69 74 20 69 73 20 |able. I|f it is |
|00001530| 6e 6f 74 2c 20 74 68 65 | 20 70 72 69 6e 74 65 72 |not, the| printer|
|00001540| 20 64 72 69 76 65 72 0d | 2f 2f 20 20 77 69 6c 6c | driver.|// will|
|00001550| 20 72 65 74 75 72 6e 20 | 72 65 73 4e 6f 74 46 6f | return |resNotFo|
|00001560| 75 6e 64 20 69 6e 20 50 | 72 45 72 72 6f 72 2e 20 |und in P|rError. |
|00001570| 20 57 65 20 77 69 6c 6c | 20 74 68 65 6e 20 63 6c | We will| then cl|
|00001580| 65 61 72 20 74 68 65 20 | 65 72 72 6f 72 20 69 6e |ear the |error in|
|00001590| 20 50 72 45 72 72 6f 72 | 20 77 69 74 68 0d 2f 2f | PrError| with.//|
|000015a0| 20 20 50 72 53 65 74 45 | 72 72 6f 72 20 28 30 29 | PrSetE|rror (0)|
|000015b0| 20 61 6e 64 20 70 72 6f | 63 65 65 64 20 77 69 74 | and pro|ceed wit|
|000015c0| 68 20 70 72 69 6e 74 69 | 6e 67 20 77 69 74 68 6f |h printi|ng witho|
|000015d0| 75 74 20 50 72 47 65 6e | 65 72 61 6c 27 73 20 6f |ut PrGen|eral's o|
|000015e0| 70 63 6f 64 65 73 2e 20 | 20 49 66 20 77 65 20 64 |pcodes. | If we d|
|000015f0| 69 64 20 6e 6f 74 0d 2f | 2f 20 20 63 6c 65 61 72 |id not./|/ clear|
|00001600| 20 74 68 65 20 65 72 72 | 6f 72 2c 20 79 6f 75 20 | the err|or, you |
|00001610| 77 6f 75 6c 64 20 72 65 | 63 65 69 76 65 20 74 68 |would re|ceive th|
|00001620| 65 20 65 72 72 6f 72 20 | 69 6e 20 50 72 45 72 72 |e error |in PrErr|
|00001630| 6f 72 20 77 68 65 6e 20 | 69 74 20 77 61 73 20 63 |or when |it was c|
|00001640| 68 65 63 6b 65 64 2c 20 | 74 68 65 72 65 62 79 0d |hecked, |thereby.|
|00001650| 2f 2f 20 20 70 72 65 76 | 65 6e 74 69 6e 67 20 79 |// prev|enting y|
|00001660| 6f 75 72 20 61 70 70 20 | 66 72 6f 6d 20 70 72 69 |our app |from pri|
|00001670| 6e 74 69 6e 67 2e 0d 0d | 42 6f 6f 6c 65 61 6e 20 |nting...|Boolean |
|00001680| 74 65 73 74 46 6f 72 50 | 72 47 65 6e 65 72 61 6c |testForP|rGeneral|
|00001690| 20 28 29 0d 7b 0d 20 20 | 09 54 47 65 74 52 6f 74 | ().{. |.TGetRot|
|000016a0| 6e 42 6c 6b 09 47 65 74 | 52 6f 74 52 65 63 3b 0d |nBlk.Get|RotRec;.|
|000016b0| 20 20 09 73 68 6f 72 74 | 20 20 09 09 70 72 69 6e | .short| ..prin|
|000016c0| 74 45 72 72 20 3d 20 30 | 3b 0d 20 20 0d 20 20 20 |tErr = 0|;. . |
|000016d0| 20 47 65 74 52 6f 74 52 | 65 63 2e 69 4f 70 43 6f | GetRotR|ec.iOpCo|
|000016e0| 64 65 20 3d 20 67 65 74 | 52 6f 74 6e 4f 70 3b 20 |de = get|RotnOp; |
|000016f0| 20 20 20 2f 2f 20 57 65 | 20 77 69 6c 6c 20 74 65 | // We| will te|
|00001700| 73 74 20 66 6f 72 20 50 | 72 47 65 6e 65 72 61 6c |st for P|rGeneral|
|00001710| 20 77 69 74 68 20 74 68 | 65 20 6c 61 6e 64 73 63 | with th|e landsc|
|00001720| 61 70 65 20 6f 70 63 6f | 64 65 2e 2e 2e 0d 20 20 |ape opco|de.... |
|00001730| 20 20 47 65 74 52 6f 74 | 52 65 63 2e 68 50 72 69 | GetRot|Rec.hPri|
|00001740| 6e 74 20 3d 20 67 50 72 | 52 65 63 48 64 6c 3b 0d |nt = gPr|RecHdl;.|
|00001750| 20 0d 20 20 09 50 72 47 | 65 6e 65 72 61 6c 20 28 | . .PrG|eneral (|
|00001760| 28 50 74 72 29 20 26 47 | 65 74 52 6f 74 52 65 63 |(Ptr) &G|etRotRec|
|00001770| 29 3b 09 0d 20 20 0d 20 | 20 09 70 72 69 6e 74 45 |);.. . | .printE|
|00001780| 72 72 20 3d 20 50 72 45 | 72 72 6f 72 20 28 29 3b |rr = PrE|rror ();|
|00001790| 0d 20 20 0d 20 20 09 69 | 66 20 28 70 72 69 6e 74 |. . .i|f (print|
|000017a0| 45 72 72 20 3d 3d 20 6e | 6f 45 72 72 29 20 20 20 |Err == n|oErr) |
|000017b0| 20 20 20 20 20 20 20 20 | 20 2f 2f 20 20 50 72 47 | | // PrG|
|000017c0| 65 6e 65 72 61 6c 20 69 | 73 20 73 75 70 70 6f 72 |eneral i|s suppor|
|000017d0| 74 65 64 20 62 79 20 74 | 68 65 20 63 75 72 72 65 |ted by t|he curre|
|000017e0| 6e 74 20 64 72 69 76 65 | 72 2e 2e 2e 0d 20 20 20 |nt drive|r.... |
|000017f0| 20 20 20 72 65 74 75 72 | 6e 20 28 74 72 75 65 29 | retur|n (true)|
|00001800| 3b 0d 20 20 09 65 6c 73 | 65 20 0d 20 20 20 20 20 |;. .els|e . |
|00001810| 20 7b 0d 09 20 20 20 69 | 66 20 28 70 72 69 6e 74 | {.. i|f (print|
|00001820| 45 72 72 20 3d 3d 20 72 | 65 73 4e 6f 74 46 6f 75 |Err == r|esNotFou|
|00001830| 6e 64 29 0d 20 20 20 20 | 20 20 20 20 20 7b 0d 09 |nd). | {..|
|00001840| 20 20 20 20 20 20 20 50 | 72 53 65 74 45 72 72 6f | P|rSetErro|
|00001850| 72 20 28 6e 6f 45 72 72 | 29 3b 20 20 20 20 20 20 |r (noErr|); |
|00001860| 20 20 2f 2f 20 53 69 6e | 63 65 20 50 72 47 65 6e | // Sin|ce PrGen|
|00001870| 65 72 61 6c 20 69 73 20 | 6e 6f 74 20 61 76 61 69 |eral is |not avai|
|00001880| 6c 61 62 6c 65 2c 20 77 | 65 20 77 61 6e 74 20 74 |lable, w|e want t|
|00001890| 6f 20 63 6c 65 61 72 20 | 50 72 45 72 72 6f 72 2c |o clear |PrError,|
|000018a0| 0d 09 20 20 20 20 20 20 | 20 6e 6f 50 72 47 65 6e |.. | noPrGen|
|000018b0| 65 72 61 6c 41 6c 65 72 | 74 20 28 29 3b 20 20 20 |eralAler|t (); |
|000018c0| 20 20 20 20 2f 2f 20 77 | 68 69 63 68 20 77 69 6c | // w|hich wil|
|000018d0| 6c 20 65 6e 61 62 6c 65 | 20 79 6f 75 72 20 61 70 |l enable| your ap|
|000018e0| 70 20 74 6f 20 6b 65 65 | 70 20 70 72 69 6e 74 69 |p to kee|p printi|
|000018f0| 6e 67 20 77 69 74 68 6f | 75 74 0d 09 20 20 20 20 |ng witho|ut.. |
|00001900| 20 20 20 72 65 74 75 72 | 6e 20 28 66 61 6c 73 65 | retur|n (false|
|00001910| 29 3b 20 20 20 20 20 20 | 20 20 20 20 20 20 2f 2f |); | //|
|00001920| 20 50 72 47 65 6e 65 72 | 61 6c 27 73 20 6f 70 63 | PrGener|al's opc|
|00001930| 6f 64 65 73 2e 2e 2e 0d | 09 20 20 20 20 20 7d 0d |odes....|. }.|
|00001940| 09 20 20 20 65 6c 73 65 | 20 0d 09 20 20 20 20 7b |. else| .. {|
|00001950| 0d 09 20 20 20 20 20 20 | 50 72 43 6c 6f 73 65 20 |.. |PrClose |
|00001960| 28 29 3b 0d 20 20 20 20 | 20 20 20 20 20 20 41 6c |();. | Al|
|00001970| 65 72 74 55 73 65 72 20 | 28 29 3b 20 20 20 20 20 |ertUser |(); |
|00001980| 20 20 20 20 20 20 20 20 | 20 20 2f 2f 20 41 6e 6f | | // Ano|
|00001990| 74 68 65 72 20 74 79 70 | 65 20 6f 66 20 70 72 69 |ther typ|e of pri|
|000019a0| 6e 74 20 65 72 72 6f 72 | 20 6f 63 63 75 72 72 65 |nt error| occurre|
|000019b0| 64 2c 20 74 68 65 72 65 | 66 6f 72 65 20 41 6c 65 |d, there|fore Ale|
|000019c0| 72 74 55 73 65 72 0d 09 | 20 20 20 20 7d 0d 09 20 |rtUser..| }.. |
|000019d0| 20 7d 0d 7d 20 20 2f 2f | 20 20 65 6e 64 20 6f 66 | }.} //| end of|
|000019e0| 20 74 65 73 74 46 6f 72 | 50 72 47 65 6e 65 72 61 | testFor|PrGenera|
|000019f0| 6c 0d 0d 0d 0d 2f 2f 2d | 2d 2d 2d 2d 2d 20 73 61 |l....//-|----- sa|
|00001a00| 76 65 52 65 73 6f 6c 75 | 74 69 6f 6e 20 2d 2d 2d |veResolu|tion ---|
|00001a10| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00001a20| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00001a30| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00001a40| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 0d 2f 2f 0d 2f 2f |--------|--.//.//|
|00001a50| 09 57 65 20 6e 65 65 64 | 20 74 6f 20 73 61 76 65 |.We need| to save|
|00001a60| 20 74 68 65 20 6f 72 69 | 67 69 6e 61 6c 20 72 65 | the ori|ginal re|
|00001a70| 73 6f 6c 75 74 69 6f 6e | 20 6f 66 20 74 68 65 20 |solution| of the |
|00001a80| 63 75 72 72 65 6e 74 20 | 70 72 69 6e 74 65 72 20 |current |printer |
|00001a90| 64 72 69 76 65 72 2c 20 | 77 68 69 63 68 20 77 69 |driver, |which wi|
|00001aa0| 6c 6c 0d 2f 2f 09 65 6e | 61 62 6c 65 20 75 73 20 |ll.//.en|able us |
|00001ab0| 74 6f 20 72 65 73 65 74 | 20 74 68 65 20 72 65 73 |to reset| the res|
|00001ac0| 6f 6c 75 74 69 75 6f 6e | 20 69 66 20 74 68 65 20 |olutiuon| if the |
|00001ad0| 75 73 65 72 20 74 75 72 | 6e 73 20 74 68 65 20 22 |user tur|ns the "|
|00001ae0| 68 69 67 68 20 72 65 73 | 6f 6c 75 74 69 6f 6e 22 |high res|olution"|
|00001af0| 20 70 72 69 6e 74 69 6e | 67 0d 2f 2f 09 6d 65 6e | printin|g.//.men|
|00001b00| 75 20 69 74 65 6d 20 22 | 6f 66 66 22 2e 0d 2f 2f |u item "|off"..//|
|00001b10| 0d 0d 76 6f 69 64 20 73 | 61 76 65 52 65 73 6f 6c |..void s|aveResol|
|00001b20| 75 74 69 6f 6e 20 28 29 | 0d 7b 0d 09 67 4f 72 69 |ution ()|.{..gOri|
|00001b30| 67 69 6e 61 6c 69 56 52 | 65 73 20 3d 20 28 2a 2a |ginaliVR|es = (**|
|00001b40| 67 50 72 52 65 63 48 64 | 6c 29 2e 70 72 49 6e 66 |gPrRecHd|l).prInf|
|00001b50| 6f 2e 69 56 52 65 73 3b | 0d 09 67 4f 72 69 67 69 |o.iVRes;|..gOrigi|
|00001b60| 6e 61 6c 69 48 52 65 73 | 20 3d 20 28 2a 2a 67 50 |naliHRes| = (**gP|
|00001b70| 72 52 65 63 48 64 6c 29 | 2e 70 72 49 6e 66 6f 2e |rRecHdl)|.prInfo.|
|00001b80| 69 48 52 65 73 3b 0d 7d | 0d 0d 0d 0d 2f 2f 2d 2d |iHRes;.}|....//--|
|00001b90| 2d 2d 2d 2d 20 72 65 73 | 65 74 53 65 74 52 73 6c |---- res|etSetRsl|
|00001ba0| 20 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d | -------|--------|
|00001bb0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00001bc0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00001bd0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00001be0| 2d 0d 2f 2f 0d 2f 2f 09 | 72 65 73 65 74 53 65 74 |-.//.//.|resetSet|
|00001bf0| 52 73 6c 20 77 69 6c 6c | 20 72 65 73 65 74 20 74 |Rsl will| reset t|
|00001c00| 68 65 20 72 65 73 6f 6c | 75 74 69 6f 6e 20 6f 66 |he resol|ution of|
|00001c10| 20 74 68 65 20 70 72 69 | 6e 74 20 68 61 6e 64 6c | the pri|nt handl|
|00001c20| 65 2c 20 62 61 63 6b 20 | 74 6f 20 69 74 27 73 20 |e, back |to it's |
|00001c30| 6f 72 67 69 6e 61 6c 20 | 0d 2f 2f 09 62 65 66 6f |orginal |.//.befo|
|00001c40| 72 65 20 75 73 69 6e 67 | 20 74 68 65 20 53 65 74 |re using| the Set|
|00001c50| 52 73 6c 20 6f 70 63 6f | 64 65 2e 20 20 49 66 20 |Rsl opco|de. If |
|00001c60| 74 68 65 20 75 73 65 72 | 20 68 61 73 20 6e 6f 74 |the user| has not|
|00001c70| 20 63 68 61 6e 67 65 64 | 20 74 68 65 20 70 72 69 | changed| the pri|
|00001c80| 6e 74 65 72 2c 20 77 65 | 20 0d 2f 2f 09 77 69 6c |nter, we| .//.wil|
|00001c90| 6c 20 72 65 73 65 74 20 | 74 68 65 20 72 65 73 6f |l reset |the reso|
|00001ca0| 6c 75 74 69 6f 6e 20 6f | 66 20 74 68 65 20 70 72 |lution o|f the pr|
|00001cb0| 69 6e 74 65 72 20 64 72 | 69 76 65 72 20 77 69 74 |inter dr|iver wit|
|00001cc0| 68 20 61 20 63 61 6c 6c | 20 74 6f 20 74 68 65 20 |h a call| to the |
|00001cd0| 53 65 74 52 73 6c 20 6f | 70 63 6f 64 65 20 0d 2f |SetRsl o|pcode ./|
|00001ce0| 2f 20 20 77 69 74 68 20 | 74 68 65 20 6f 72 67 69 |/ with |the orgi|
|00001cf0| 6e 61 6c 20 72 65 73 6f | 6c 75 74 69 6f 6e 73 20 |nal reso|lutions |
|00001d00| 74 68 61 74 20 77 65 72 | 65 20 73 61 76 65 64 20 |that wer|e saved |
|00001d10| 62 79 20 74 68 65 20 66 | 75 6e 63 74 69 6f 6e 20 |by the f|unction |
|00001d20| 73 61 76 65 52 65 73 6f | 6c 75 74 69 6f 6e 2e 20 |saveReso|lution. |
|00001d30| 49 66 20 0d 2f 2f 20 20 | 74 68 65 20 75 73 65 72 |If .// |the user|
|00001d40| 20 68 61 73 20 73 65 6c | 65 63 74 65 64 20 61 20 | has sel|ected a |
|00001d50| 64 69 66 66 65 72 65 6e | 74 20 70 72 69 6e 74 65 |differen|t printe|
|00001d60| 72 20 76 69 61 20 74 68 | 65 20 43 68 6f 6f 73 65 |r via th|e Choose|
|00001d70| 72 2c 20 77 65 20 77 69 | 6c 6c 20 63 61 6c 6c 20 |r, we wi|ll call |
|00001d80| 50 72 69 6e 74 44 65 66 | 61 75 6c 74 20 0d 2f 2f |PrintDef|ault .//|
|00001d90| 20 20 6f 6e 20 6f 75 72 | 20 70 72 69 6e 74 20 72 | on our| print r|
|00001da0| 65 63 6f 72 64 2e 20 20 | 0d 2f 2f 0d 0d 76 6f 69 |ecord. |.//..voi|
|00001db0| 64 20 72 65 73 65 74 53 | 65 74 52 73 6c 20 28 29 |d resetS|etRsl ()|
|00001dc0| 0d 7b 0d 09 54 53 65 74 | 52 73 6c 42 6c 6b 09 73 |.{..TSet|RslBlk.s|
|00001dd0| 65 74 52 65 73 52 65 63 | 3b 0d 09 54 48 50 72 69 |etResRec|;..THPri|
|00001de0| 6e 74 20 09 6c 6f 63 61 | 6c 50 72 52 65 63 48 64 |nt .loca|lPrRecHd|
|00001df0| 6c 3b 0d 09 73 68 6f 72 | 74 09 09 6c 61 74 65 73 |l;..shor|t..lates|
|00001e00| 74 44 72 69 76 65 72 56 | 65 72 73 3b 0d 0d 09 2f |tDriverV|ers;.../|
|00001e10| 2f 20 20 43 72 65 61 74 | 65 20 61 20 22 6e 65 77 |/ Creat|e a "new|
|00001e20| 22 20 70 72 69 6e 74 20 | 72 65 63 6f 72 64 20 74 |" print |record t|
|00001e30| 6f 20 63 6f 6d 70 61 72 | 65 20 77 69 74 68 2e 2e |o compar|e with..|
|00001e40| 2e 0d 09 0d 09 6c 6f 63 | 61 6c 50 72 52 65 63 48 |.....loc|alPrRecH|
|00001e50| 64 6c 20 3d 20 28 54 48 | 50 72 69 6e 74 29 20 4e |dl = (TH|Print) N|
|00001e60| 65 77 48 61 6e 64 6c 65 | 28 73 69 7a 65 6f 66 28 |ewHandle|(sizeof(|
|00001e70| 54 50 72 69 6e 74 29 29 | 3b 0d 09 69 66 20 28 4d |TPrint))|;..if (M|
|00001e80| 65 6d 45 72 72 6f 72 28 | 29 20 3d 3d 20 6e 6f 45 |emError(|) == noE|
|00001e90| 72 72 20 26 26 20 6c 6f | 63 61 6c 50 72 52 65 63 |rr && lo|calPrRec|
|00001ea0| 48 64 6c 20 21 3d 20 6e | 69 6c 29 0d 09 7b 0d 09 |Hdl != n|il)..{..|
|00001eb0| 09 50 72 69 6e 74 44 65 | 66 61 75 6c 74 20 28 6c |.PrintDe|fault (l|
|00001ec0| 6f 63 61 6c 50 72 52 65 | 63 48 64 6c 29 3b 0d 09 |ocalPrRe|cHdl);..|
|00001ed0| 0d 09 09 6c 61 74 65 73 | 74 44 72 69 76 65 72 56 |...lates|tDriverV|
|00001ee0| 65 72 73 20 3d 20 50 72 | 44 72 76 72 56 65 72 73 |ers = Pr|DrvrVers|
|00001ef0| 20 28 29 3b 0d 09 0d 09 | 09 2f 2f 20 09 57 65 20 | ();....|.// .We |
|00001f00| 6e 65 65 64 20 74 6f 20 | 64 65 74 65 72 6d 69 6e |need to |determin|
|00001f10| 65 20 69 66 20 74 68 65 | 20 75 73 65 72 20 63 68 |e if the| user ch|
|00001f20| 61 6e 67 65 64 20 74 68 | 65 20 70 72 69 6e 74 65 |anged th|e printe|
|00001f30| 72 20 64 72 69 76 65 72 | 20 76 69 61 20 43 68 6f |r driver| via Cho|
|00001f40| 6f 73 65 72 2e 20 20 0d | 09 09 2f 2f 09 57 68 69 |oser. .|..//.Whi|
|00001f50| 63 68 20 77 6f 75 6c 64 | 20 62 65 20 61 20 70 72 |ch would| be a pr|
|00001f60| 6f 62 6c 65 6d 20 62 65 | 63 61 75 73 65 20 74 68 |oblem be|cause th|
|00001f70| 65 20 72 65 73 6f 6c 75 | 74 69 6f 6e 73 20 6d 69 |e resolu|tions mi|
|00001f80| 67 68 74 20 6e 6f 74 20 | 6d 61 74 63 68 20 61 63 |ght not |match ac|
|00001f90| 72 6f 73 73 20 0d 09 09 | 2f 2f 09 64 69 66 66 65 |ross ...|//.diffe|
|00001fa0| 72 65 6e 74 20 70 72 69 | 6e 74 65 72 20 64 72 69 |rent pri|nter dri|
|00001fb0| 76 65 72 73 2e 20 57 65 | 20 61 6c 73 6f 20 63 68 |vers. We| also ch|
|00001fc0| 65 63 6b 20 74 6f 20 73 | 65 65 20 69 66 20 74 68 |eck to s|ee if th|
|00001fd0| 65 20 76 65 72 73 69 6f | 6e 20 6e 75 6d 62 65 72 |e versio|n number|
|00001fe0| 20 68 61 73 20 0d 09 09 | 2f 2f 09 63 68 61 6e 67 | has ...|//.chang|
|00001ff0| 65 64 2c 20 77 68 69 63 | 68 20 77 69 6c 6c 20 69 |ed, whic|h will i|
|00002000| 6e 73 75 72 65 20 74 68 | 61 74 20 74 68 65 20 75 |nsure th|at the u|
|00002010| 73 65 72 20 64 69 64 20 | 6e 6f 74 20 63 68 61 6e |ser did |not chan|
|00002020| 67 65 20 74 68 65 20 70 | 72 69 6e 74 65 72 20 64 |ge the p|rinter d|
|00002030| 72 69 76 65 72 0d 09 09 | 2f 2f 09 74 6f 20 61 20 |river...|//.to a |
|00002040| 64 69 66 66 65 72 65 6e | 74 20 70 72 69 6e 74 65 |differen|t printe|
|00002050| 72 20 64 72 69 76 65 72 | 20 76 65 72 73 69 6f 6e |r driver| version|
|00002060| 2e 20 20 54 68 69 73 20 | 69 73 20 69 6d 70 6f 72 |. This |is impor|
|00002070| 74 61 6e 74 2c 20 62 65 | 63 61 75 73 65 20 65 61 |tant, be|cause ea|
|00002080| 72 6c 69 65 72 0d 09 09 | 2f 2f 09 76 65 72 73 69 |rlier...|//.versi|
|00002090| 6f 6e 73 20 6f 66 20 74 | 68 65 20 49 6d 61 67 65 |ons of t|he Image|
|000020a0| 57 72 69 74 65 72 20 28 | 69 2e 65 2e 20 62 65 66 |Writer (|i.e. bef|
|000020b0| 6f 72 65 20 76 32 2e 35 | 29 20 64 69 64 20 6e 6f |ore v2.5|) did no|
|000020c0| 74 20 73 75 70 70 6f 72 | 74 20 50 72 47 65 6e 65 |t suppor|t PrGene|
|000020d0| 72 61 6c 2e 0d 09 09 2f | 2f 20 20 49 66 20 74 68 |ral..../|/ If th|
|000020e0| 65 79 20 68 61 76 65 20 | 63 68 61 6e 67 65 64 20 |ey have |changed |
|000020f0| 74 68 65 20 70 72 69 6e | 74 65 72 20 64 72 69 76 |the prin|ter driv|
|00002100| 65 72 2c 20 63 61 6c 6c | 20 50 72 69 6e 74 44 65 |er, call| PrintDe|
|00002110| 66 61 75 6c 74 20 6f 6e | 20 6f 75 72 20 67 6c 6f |fault on| our glo|
|00002120| 62 61 6c 20 70 72 69 6e | 74 20 0d 09 09 2f 2f 20 |bal prin|t ...// |
|00002130| 20 72 65 63 6f 72 64 20 | 68 61 6e 64 6c 65 20 74 | record |handle t|
|00002140| 6f 20 75 70 64 61 74 65 | 20 69 74 2e 0d 09 09 0d |o update| it.....|
|00002150| 09 09 69 66 20 28 28 28 | 28 2a 2a 67 50 72 52 65 |..if (((|(**gPrRe|
|00002160| 63 48 64 6c 29 2e 70 72 | 53 74 6c 2e 77 44 65 76 |cHdl).pr|Stl.wDev|
|00002170| 29 20 3e 3e 20 38 29 20 | 3d 3d 20 28 28 28 2a 2a |) >> 8) |== (((**|
|00002180| 6c 6f 63 61 6c 50 72 52 | 65 63 48 64 6c 29 2e 70 |localPrR|ecHdl).p|
|00002190| 72 53 74 6c 2e 77 44 65 | 76 29 20 3e 3e 20 38 29 |rStl.wDe|v) >> 8)|
|000021a0| 0d 09 09 09 20 7c 7c 20 | 28 6c 61 74 65 73 74 44 |.... || |(latestD|
|000021b0| 72 69 76 65 72 56 65 72 | 73 20 3d 3d 20 67 4f 72 |riverVer|s == gOr|
|000021c0| 69 67 69 6e 61 6c 44 72 | 69 76 65 72 56 65 72 73 |iginalDr|iverVers|
|000021d0| 29 29 0d 09 09 20 20 7b | 0d 09 09 09 2f 2f 09 52 |))... {|....//.R|
|000021e0| 65 73 65 74 20 74 68 65 | 20 70 72 69 6e 74 20 72 |eset the| print r|
|000021f0| 65 63 6f 72 64 20 74 6f | 20 74 68 65 20 6f 72 69 |ecord to| the ori|
|00002200| 67 69 6e 61 6c 20 72 65 | 73 6f 6c 75 74 69 6f 6e |ginal re|solution|
|00002210| 73 2e 2e 2e 0d 09 09 09 | 0d 09 09 09 73 65 74 52 |s.......|....setR|
|00002220| 65 73 52 65 63 2e 69 4f | 70 43 6f 64 65 20 3d 20 |esRec.iO|pCode = |
|00002230| 73 65 74 52 73 6c 4f 70 | 3b 0d 09 09 09 73 65 74 |setRslOp|;....set|
|00002240| 52 65 73 52 65 63 2e 68 | 50 72 69 6e 74 20 3d 20 |ResRec.h|Print = |
|00002250| 67 50 72 52 65 63 48 64 | 6c 3b 0d 09 0d 09 09 09 |gPrRecHd|l;......|
|00002260| 73 65 74 52 65 73 52 65 | 63 2e 69 58 52 73 6c 20 |setResRe|c.iXRsl |
|00002270| 3d 20 67 4f 72 69 67 69 | 6e 61 6c 69 48 52 65 73 |= gOrigi|naliHRes|
|00002280| 3b 0d 09 09 09 73 65 74 | 52 65 73 52 65 63 2e 69 |;....set|ResRec.i|
|00002290| 59 52 73 6c 20 3d 20 67 | 4f 72 69 67 69 6e 61 6c |YRsl = g|Original|
|000022a0| 69 56 52 65 73 3b 0d 09 | 09 09 0d 09 09 09 20 0d |iVRes;..|...... .|
|000022b0| 09 09 09 2f 2f 20 57 65 | 20 64 6f 20 6e 6f 74 20 |...// We| do not |
|000022c0| 6e 65 65 64 20 74 6f 20 | 63 68 65 63 6b 20 61 6e |need to |check an|
|000022d0| 79 20 50 72 47 65 6e 65 | 72 61 6c 20 65 72 72 6f |y PrGene|ral erro|
|000022e0| 72 73 2e 20 57 68 79 3f | 20 57 65 20 6b 6e 6f 77 |rs. Why?| We know|
|000022f0| 20 74 68 61 74 20 74 68 | 69 73 20 6f 70 63 6f 64 | that th|is opcod|
|00002300| 65 20 0d 09 09 09 2f 2f | 20 69 73 20 73 75 70 70 |e ....//| is supp|
|00002310| 6f 72 74 65 64 20 61 6e | 64 20 77 65 20 61 72 65 |orted an|d we are|
|00002320| 20 6e 6f 74 20 75 73 69 | 6e 67 20 61 6e 20 75 6e | not usi|ng an un|
|00002330| 73 75 70 70 6f 72 74 65 | 64 20 72 65 73 6f 6c 75 |supporte|d resolu|
|00002340| 74 69 6f 6e 2e 2e 2e 0d | 09 09 09 0d 09 09 09 50 |tion....|.......P|
|00002350| 72 47 65 6e 65 72 61 6c | 20 28 28 50 74 72 29 28 |rGeneral| ((Ptr)(|
|00002360| 26 73 65 74 52 65 73 52 | 65 63 29 29 3b 09 20 0d |&setResR|ec));. .|
|00002370| 09 0d 09 09 09 67 53 63 | 61 6c 65 20 3d 20 31 3b |.....gSc|ale = 1;|
|00002380| 0d 09 09 09 67 4d 61 78 | 44 50 49 20 3d 20 67 4f |....gMax|DPI = gO|
|00002390| 72 69 67 69 6e 61 6c 69 | 48 52 65 73 3b 09 09 09 |riginali|HRes;...|
|000023a0| 09 0d 09 0d 09 09 09 69 | 66 20 28 50 72 45 72 72 |.......i|f (PrErr|
|000023b0| 6f 72 20 28 29 20 21 3d | 20 6e 6f 45 72 72 29 0d |or () !=| noErr).|
|000023c0| 09 09 09 20 7b 0d 09 09 | 09 20 20 20 50 72 43 6c |... {...|. PrCl|
|000023d0| 6f 73 65 20 28 29 3b 20 | 20 20 20 20 20 20 20 20 |ose (); | |
|000023e0| 20 2f 2f 20 20 57 65 20 | 72 65 63 65 69 76 65 64 | // We |received|
|000023f0| 20 61 6e 20 65 72 72 6f | 72 20 69 6e 20 50 72 45 | an erro|r in PrE|
|00002400| 72 72 6f 72 20 61 66 74 | 65 72 20 63 61 6c 6c 69 |rror aft|er calli|
|00002410| 6e 67 20 50 72 47 65 6e | 65 72 61 6c 2e 0d 09 09 |ng PrGen|eral....|
|00002420| 09 20 20 20 41 6c 65 72 | 74 55 73 65 72 20 28 29 |. Aler|tUser ()|
|00002430| 3b 20 20 20 20 20 20 20 | 20 2f 2f 20 20 54 68 65 |; | // The|
|00002440| 72 65 66 6f 72 65 2c 20 | 63 6c 6f 73 65 20 74 68 |refore, |close th|
|00002450| 65 20 50 72 69 6e 74 20 | 4d 61 6e 61 67 65 72 20 |e Print |Manager |
|00002460| 61 6e 64 20 61 6c 65 72 | 74 20 74 68 65 20 75 73 |and aler|t the us|
|00002470| 65 72 2e 0d 09 09 09 20 | 7d 0d 09 09 20 20 7d 0d |er..... |}... }.|
|00002480| 09 09 20 65 6c 73 65 20 | 20 50 72 69 6e 74 44 65 |.. else | PrintDe|
|00002490| 66 61 75 6c 74 20 28 67 | 50 72 52 65 63 48 64 6c |fault (g|PrRecHdl|
|000024a0| 29 3b 09 0d 09 09 09 0d | 09 09 69 66 20 28 6c 6f |);......|..if (lo|
|000024b0| 63 61 6c 50 72 52 65 63 | 48 64 6c 20 21 3d 20 6e |calPrRec|Hdl != n|
|000024c0| 69 6c 29 20 20 44 69 73 | 70 6f 73 48 61 6e 64 6c |il) Dis|posHandl|
|000024d0| 65 28 28 48 61 6e 64 6c | 65 29 20 6c 6f 63 61 6c |e((Handl|e) local|
|000024e0| 50 72 52 65 63 48 64 6c | 29 3b 0d 09 7d 0d 0d 09 |PrRecHdl|);..}...|
|000024f0| 09 2f 2f 20 41 6e 20 65 | 72 72 6f 72 20 6f 63 63 |.// An e|rror occ|
|00002500| 75 72 72 65 64 20 61 6c | 6c 6f 63 61 74 69 6e 67 |urred al|locating|
|00002510| 20 6e 65 77 20 70 72 69 | 6e 74 20 72 65 63 6f 72 | new pri|nt recor|
|00002520| 64 2c 20 63 6c 6f 73 65 | 20 74 68 65 20 50 72 69 |d, close| the Pri|
|00002530| 6e 74 20 4d 61 6e 61 67 | 65 72 20 61 6e 64 20 61 |nt Manag|er and a|
|00002540| 6c 65 72 74 20 74 68 65 | 20 75 73 65 72 0d 09 65 |lert the| user..e|
|00002550| 6c 73 65 0d 09 7b 0d 09 | 09 50 72 43 6c 6f 73 65 |lse..{..|.PrClose|
|00002560| 20 28 29 3b 0d 09 09 41 | 6c 65 72 74 55 73 65 72 | ();...A|lertUser|
|00002570| 28 29 3b 0d 09 7d 0d 0d | 7d 09 2f 2f 20 20 65 6e |();..}..|}.// en|
|00002580| 64 20 6f 66 20 72 65 73 | 65 74 53 65 74 52 73 6c |d of res|etSetRsl|
|00002590| 0d 0d 0d 0d 0d 2f 2f 2d | 2d 2d 2d 2d 2d 20 73 65 |.....//-|----- se|
|000025a0| 74 4d 61 78 52 65 73 6f | 6c 75 74 69 6f 6e 20 2d |tMaxReso|lution -|
|000025b0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|000025c0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|000025d0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|000025e0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 0d 2f 2f 0d 2f 2f |--------|--.//.//|
|000025f0| 09 73 65 74 4d 61 78 52 | 65 73 6f 6c 75 74 69 6f |.setMaxR|esolutio|
|00002600| 6e 20 77 69 6c 6c 20 66 | 69 6e 64 20 74 68 65 20 |n will f|ind the |
|00002610| 68 69 67 68 65 73 74 20 | 22 73 71 75 61 72 65 22 |highest |"square"|
|00002620| 20 72 65 73 6f 6c 75 74 | 69 6f 6e 20 73 75 70 70 | resolut|ion supp|
|00002630| 6f 72 74 65 64 20 62 79 | 20 74 68 65 20 63 75 72 |orted by| the cur|
|00002640| 72 65 6e 74 6c 79 20 0d | 2f 2f 09 73 65 6c 65 63 |rently .|//.selec|
|00002650| 74 65 64 20 70 72 69 6e | 74 65 72 20 64 72 69 76 |ted prin|ter driv|
|00002660| 65 72 20 61 6e 64 20 73 | 65 74 20 74 68 65 20 50 |er and s|et the P|
|00002670| 72 69 6e 74 20 4d 61 6e | 61 67 65 72 27 73 20 47 |rint Man|ager's G|
|00002680| 72 61 66 50 6f 72 74 20 | 74 6f 20 74 68 69 73 20 |rafPort |to this |
|00002690| 72 65 73 6f 6c 75 74 69 | 6f 6e 2e 20 0d 2f 2f 09 |resoluti|on. .//.|
|000026a0| 54 68 69 73 20 77 69 6c | 6c 20 65 6e 61 62 6c 65 |This wil|l enable|
|000026b0| 20 68 69 67 68 20 72 65 | 73 6f 6c 75 74 69 6f 6e | high re|solution|
|000026c0| 20 70 72 69 6e 74 69 6e | 67 20 75 73 69 6e 67 20 | printin|g using |
|000026d0| 74 68 65 20 73 74 61 6e | 64 61 72 64 20 51 75 69 |the stan|dard Qui|
|000026e0| 63 6b 64 72 61 77 20 63 | 61 6c 6c 73 2e 20 20 57 |ckdraw c|alls. W|
|000026f0| 65 0d 2f 2f 09 77 69 6c | 6c 20 72 65 74 75 72 6e |e.//.wil|l return|
|00002700| 20 74 68 65 20 72 65 73 | 6f 6c 75 74 69 6f 6e 20 | the res|olution |
|00002710| 74 68 61 74 20 69 73 20 | 66 6f 75 6e 64 20 62 79 |that is |found by|
|00002720| 20 6f 75 72 20 63 61 6c | 6c 73 20 74 6f 20 47 65 | our cal|ls to Ge|
|00002730| 74 52 73 6c 44 61 74 61 | 2e 20 20 49 66 20 74 68 |tRslData|. If th|
|00002740| 65 20 0d 2f 2f 09 47 65 | 74 52 73 6c 44 61 74 61 |e .//.Ge|tRslData|
|00002750| 20 61 6e 64 2f 6f 72 20 | 53 65 74 52 73 6c 20 6f | and/or |SetRsl o|
|00002760| 70 63 6f 64 65 73 20 61 | 72 65 20 6e 6f 74 20 73 |pcodes a|re not s|
|00002770| 75 70 70 6f 72 74 65 64 | 20 62 79 20 74 68 65 20 |upported| by the |
|00002780| 63 75 72 72 65 6e 74 6c | 79 20 73 65 6c 65 63 74 |currentl|y select|
|00002790| 65 64 20 70 72 69 6e 74 | 65 72 0d 2f 2f 09 64 72 |ed print|er.//.dr|
|000027a0| 69 76 65 72 2c 20 77 65 | 20 77 69 6c 6c 20 72 65 |iver, we| will re|
|000027b0| 74 75 72 6e 20 30 2e 20 | 20 57 68 69 63 68 20 74 |turn 0. | Which t|
|000027c0| 65 6c 6c 73 20 74 68 65 | 20 63 61 6c 6c 69 6e 67 |ells the| calling|
|000027d0| 20 66 75 6e 63 74 69 6f | 6e 20 74 68 61 74 20 69 | functio|n that i|
|000027e0| 74 20 6d 75 73 74 20 75 | 73 65 20 61 0d 2f 2f 09 |t must u|se a.//.|
|000027f0| 73 63 61 6c 65 20 66 61 | 63 74 6f 72 20 6f 66 20 |scale fa|ctor of |
|00002800| 31 20 61 6e 64 20 61 73 | 73 75 6d 65 20 6e 6f 20 |1 and as|sume no |
|00002810| 53 65 74 52 73 6c 20 73 | 75 70 70 6f 72 74 0d 2f |SetRsl s|upport./|
|00002820| 2f 0d 0d 69 6e 74 20 73 | 65 74 4d 61 78 52 65 73 |/..int s|etMaxRes|
|00002830| 6f 6c 75 74 69 6f 6e 20 | 28 29 0d 7b 0d 20 09 69 |olution |().{. .i|
|00002840| 6e 74 09 09 09 72 65 73 | 49 6e 64 65 78 3b 0d 20 |nt...res|Index;. |
|00002850| 09 0d 20 09 54 47 65 74 | 52 73 6c 42 6c 6b 09 67 |.. .TGet|RslBlk.g|
|00002860| 65 74 52 65 73 52 65 63 | 3b 0d 20 09 54 53 65 74 |etResRec|;. .TSet|
|00002870| 52 73 6c 42 6c 6b 09 73 | 65 74 52 65 73 52 65 63 |RslBlk.s|etResRec|
|00002880| 3b 0d 0d 09 2f 2f 09 53 | 61 76 65 20 74 68 65 20 |;...//.S|ave the |
|00002890| 63 75 72 72 65 6e 74 20 | 72 65 73 6f 6c 75 74 69 |current |resoluti|
|000028a0| 6f 6e 20 76 61 6c 75 65 | 73 20 66 72 6f 6d 20 74 |on value|s from t|
|000028b0| 68 65 20 69 56 52 65 73 | 20 61 6e 64 20 69 48 72 |he iVRes| and iHr|
|000028c0| 65 73 20 66 69 65 6c 64 | 73 20 66 72 6f 6d 20 0d |es field|s from .|
|000028d0| 09 2f 2f 20 20 74 68 65 | 20 50 72 4a 6f 62 20 72 |.// the| PrJob r|
|000028e0| 65 63 6f 72 64 3b 20 77 | 68 69 63 68 20 65 6e 61 |ecord; w|hich ena|
|000028f0| 62 6c 65 73 20 75 73 20 | 74 6f 20 72 65 73 65 74 |bles us |to reset|
|00002900| 20 74 68 65 20 70 72 69 | 6e 74 20 68 61 6e 64 6c | the pri|nt handl|
|00002910| 65 20 77 69 74 68 20 74 | 68 65 20 6f 72 69 67 69 |e with t|he origi|
|00002920| 6e 61 6c 20 0d 09 2f 2f | 20 20 76 61 6c 75 65 73 |nal ..//| values|
|00002930| 2c 20 69 66 20 74 68 65 | 20 75 73 65 72 20 75 6e |, if the| user un|
|00002940| 2d 63 68 65 63 6b 73 20 | 74 68 65 20 22 68 69 67 |-checks |the "hig|
|00002950| 68 20 72 65 73 6f 6c 75 | 74 69 6f 6e 22 20 6d 65 |h resolu|tion" me|
|00002960| 6e 75 20 69 74 65 6d 2e | 0d 09 0d 09 73 61 76 65 |nu item.|....save|
|00002970| 52 65 73 6f 6c 75 74 69 | 6f 6e 20 28 29 3b 20 20 |Resoluti|on (); |
|00002980| 20 0d 0d 20 09 67 65 74 | 52 65 73 52 65 63 2e 69 | .. .get|ResRec.i|
|00002990| 4f 70 43 6f 64 65 20 3d | 20 67 65 74 52 73 6c 44 |OpCode =| getRslD|
|000029a0| 61 74 61 4f 70 3b 0d 20 | 09 50 72 47 65 6e 65 72 |ataOp;. |.PrGener|
|000029b0| 61 6c 20 28 28 50 74 72 | 29 28 26 67 65 74 52 65 |al ((Ptr|)(&getRe|
|000029c0| 73 52 65 63 29 29 3b 09 | 0d 20 09 0d 20 09 2f 2f |sRec));.|. .. .//|
|000029d0| 09 57 65 20 68 61 76 65 | 20 61 6e 20 61 72 72 61 |.We have| an arra|
|000029e0| 79 20 6f 66 20 70 6f 73 | 73 69 62 6c 65 20 72 65 |y of pos|sible re|
|000029f0| 73 6f 6c 75 74 69 6f 6e | 73 2e 0d 09 2f 2f 20 20 |solution|s...// |
|00002a00| 41 66 74 65 72 20 63 68 | 65 63 6b 69 6e 67 20 66 |After ch|ecking f|
|00002a10| 6f 72 20 65 72 72 6f 72 | 73 2c 20 77 65 20 6c 6f |or error|s, we lo|
|00002a20| 6f 70 20 74 68 72 6f 75 | 67 68 20 65 61 63 68 20 |op throu|gh each |
|00002a30| 72 65 73 6f 6c 75 74 69 | 6f 6e 20 0d 20 09 2f 2f |resoluti|on . .//|
|00002a40| 09 72 61 6e 67 65 20 72 | 65 63 6f 72 64 20 6c 6f |.range r|ecord lo|
|00002a50| 6f 6b 69 6e 67 20 66 6f | 72 20 74 68 65 20 68 69 |oking fo|r the hi|
|00002a60| 67 68 65 73 74 20 72 65 | 73 6f 6c 75 74 69 6f 6e |ghest re|solution|
|00002a70| 20 61 76 61 69 6c 61 62 | 6c 65 2c 20 77 68 65 72 | availab|le, wher|
|00002a80| 65 20 78 20 61 6e 64 0d | 20 09 2f 2f 09 79 20 61 |e x and.| .//.y a|
|00002a90| 72 65 20 65 71 75 61 6c | 2e 20 54 68 69 73 20 6c |re equal|. This l|
|00002aa0| 6f 6f 70 20 6d 61 6b 65 | 73 20 6e 6f 20 61 73 73 |oop make|s no ass|
|00002ab0| 75 6d 70 74 69 6f 6e 73 | 20 61 62 6f 75 74 20 74 |umptions| about t|
|00002ac0| 68 65 20 6f 72 64 65 72 | 20 6f 66 20 74 68 65 20 |he order| of the |
|00002ad0| 0d 20 09 2f 2f 09 72 65 | 73 6f 6c 75 74 69 6f 6e |. .//.re|solution|
|00002ae0| 20 72 65 63 6f 72 64 73 | 2e 20 46 69 6e 64 20 74 | records|. Find t|
|00002af0| 68 65 20 6d 61 78 69 6d | 75 6d 20 72 65 73 6f 6c |he maxim|um resol|
|00002b00| 75 74 69 6f 6e 20 73 75 | 70 70 6f 72 74 65 64 20 |ution su|pported |
|00002b10| 62 79 20 74 68 65 20 63 | 75 72 72 65 6e 74 20 73 |by the c|urrent s|
|00002b20| 65 6c 65 63 74 65 64 20 | 64 65 76 69 63 65 2e 0d |elected |device..|
|00002b30| 20 09 2f 2f 09 53 6f 6d | 65 20 64 65 76 69 63 65 | .//.Som|e device|
|00002b40| 73 20 73 75 70 70 6f 72 | 74 20 6e 6f 6e 2d 73 71 |s suppor|t non-sq|
|00002b50| 75 61 72 65 20 61 73 70 | 65 63 74 20 72 61 74 69 |uare asp|ect rati|
|00002b60| 6f 73 20 28 69 2e 65 2e | 20 78 2d 72 65 73 20 21 |os (i.e.| x-res !|
|00002b70| 3d 20 79 2d 72 65 73 29 | 2c 20 77 65 0d 20 09 2f |= y-res)|, we. ./|
|00002b80| 2f 09 6e 65 65 64 20 74 | 6f 20 66 69 6e 64 20 74 |/.need t|o find t|
|00002b90| 68 65 20 6c 61 72 67 65 | 73 74 20 22 73 71 75 61 |he large|st "squa|
|00002ba0| 72 65 22 20 72 65 73 6f | 6c 75 74 69 6f 6e 20 73 |re" reso|lution s|
|00002bb0| 75 70 70 6f 72 74 65 64 | 2e 20 20 54 68 65 20 6c |upported|. The l|
|00002bc0| 61 73 74 20 72 67 52 73 | 6c 52 65 63 20 69 73 0d |ast rgRs|lRec is.|
|00002bd0| 09 2f 2f 20 20 74 68 65 | 20 22 68 69 67 68 65 73 |.// the| "highes|
|00002be0| 74 22 20 73 75 70 70 6f | 72 74 65 64 20 72 65 73 |t" suppo|rted res|
|00002bf0| 6f 6c 75 74 69 6f 6e 20 | 72 65 63 6f 72 64 20 66 |olution |record f|
|00002c00| 6f 72 20 61 6c 6c 20 6f | 66 20 74 68 65 20 41 70 |or all o|f the Ap|
|00002c10| 70 6c 65 20 70 72 69 6e | 74 65 72 20 64 72 69 76 |ple prin|ter driv|
|00002c20| 65 72 73 2e 0d 09 0d 20 | 09 69 66 20 28 67 65 74 |ers.... |.if (get|
|00002c30| 52 65 73 52 65 63 2e 69 | 45 72 72 6f 72 20 3d 3d |ResRec.i|Error ==|
|00002c40| 20 6e 6f 45 72 72 20 26 | 26 20 50 72 45 72 72 6f | noErr &|& PrErro|
|00002c50| 72 28 29 20 3d 3d 20 6e | 6f 45 72 72 29 0d 20 09 |r() == n|oErr). .|
|00002c60| 20 20 7b 0d 20 09 20 20 | 20 66 6f 72 20 28 72 65 | {. . | for (re|
|00002c70| 73 49 6e 64 65 78 20 3d | 20 30 3b 20 72 65 73 49 |sIndex =| 0; resI|
|00002c80| 6e 64 65 78 20 3c 20 67 | 65 74 52 65 73 52 65 63 |ndex < g|etResRec|
|00002c90| 2e 69 52 73 6c 52 65 63 | 43 6e 74 20 3b 20 72 65 |.iRslRec|Cnt ; re|
|00002ca0| 73 49 6e 64 65 78 2b 2b | 29 0d 20 09 20 20 20 20 |sIndex++|). . |
|00002cb0| 20 20 7b 0d 20 09 20 20 | 20 20 20 20 20 20 69 66 | {. . | if|
|00002cc0| 20 28 20 67 65 74 52 65 | 73 52 65 63 2e 72 67 52 | ( getRe|sRec.rgR|
|00002cd0| 73 6c 52 65 63 5b 72 65 | 73 49 6e 64 65 78 5d 2e |slRec[re|sIndex].|
|00002ce0| 69 58 52 73 6c 20 3d 3d | 0d 20 09 20 20 20 20 20 |iXRsl ==|. . |
|00002cf0| 20 20 20 20 20 20 20 20 | 20 67 65 74 52 65 73 52 | | getResR|
|00002d00| 65 63 2e 72 67 52 73 6c | 52 65 63 5b 72 65 73 49 |ec.rgRsl|Rec[resI|
|00002d10| 6e 64 65 78 5d 2e 69 59 | 52 73 6c 20 26 26 20 0d |ndex].iY|Rsl && .|
|00002d20| 20 09 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | . | |
|00002d30| 67 65 74 52 65 73 52 65 | 63 2e 72 67 52 73 6c 52 |getResRe|c.rgRslR|
|00002d40| 65 63 5b 72 65 73 49 6e | 64 65 78 5d 2e 69 58 52 |ec[resIn|dex].iXR|
|00002d50| 73 6c 20 3e 20 67 4d 61 | 78 44 50 49 29 0d 09 20 |sl > gMa|xDPI).. |
|00002d60| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 0d 09 09 | | ...|
|00002d70| 09 20 20 20 67 4d 61 78 | 44 50 49 20 3d 20 67 65 |. gMax|DPI = ge|
|00002d80| 74 52 65 73 52 65 63 2e | 72 67 52 73 6c 52 65 63 |tResRec.|rgRslRec|
|00002d90| 5b 72 65 73 49 6e 64 65 | 78 5d 2e 69 59 52 73 6c |[resInde|x].iYRsl|
|00002da0| 3b 0d 20 20 09 20 20 20 | 20 20 20 7d 0d 09 09 20 |;. . | }... |
|00002db0| 20 20 0d 20 09 20 20 20 | 2f 2f 20 20 57 65 20 6e | . . |// We n|
|00002dc0| 6f 77 20 68 61 76 65 20 | 74 68 65 20 64 65 73 69 |ow have |the desi|
|00002dd0| 72 65 64 20 72 65 73 6f | 6c 75 74 69 6f 6e 2e 20 |red reso|lution. |
|00002de0| 49 66 20 69 74 20 69 73 | 20 6e 6f 74 20 30 2c 20 |If it is| not 0, |
|00002df0| 74 68 65 6e 20 77 65 0d | 09 20 20 20 2f 2f 20 20 |then we.|. // |
|00002e00| 75 73 65 20 74 68 65 20 | 53 65 74 52 73 6c 20 6f |use the |SetRsl o|
|00002e10| 70 63 6f 64 65 20 74 6f | 20 73 65 74 20 74 68 65 |pcode to| set the|
|00002e20| 20 72 65 73 6f 6c 75 74 | 69 6f 6e 2e 0d 0d 20 20 | resolut|ion... |
|00002e30| 20 20 20 20 20 69 66 20 | 28 67 4d 61 78 44 50 49 | if |(gMaxDPI|
|00002e40| 20 21 3d 20 30 20 26 26 | 20 67 50 72 52 65 63 48 | != 0 &&| gPrRecH|
|00002e50| 64 6c 20 21 3d 20 6e 69 | 6c 29 0d 09 20 20 09 20 |dl != ni|l).. . |
|00002e60| 7b 0d 20 20 20 20 09 09 | 73 65 74 52 65 73 52 65 |{. ..|setResRe|
|00002e70| 63 2e 69 4f 70 43 6f 64 | 65 20 3d 20 73 65 74 52 |c.iOpCod|e = setR|
|00002e80| 73 6c 4f 70 3b 0d 20 20 | 20 20 09 09 73 65 74 52 |slOp;. | ..setR|
|00002e90| 65 73 52 65 63 2e 68 50 | 72 69 6e 74 20 3d 20 67 |esRec.hP|rint = g|
|00002ea0| 50 72 52 65 63 48 64 6c | 3b 0d 0d 20 20 20 20 09 |PrRecHdl|;.. .|
|00002eb0| 09 73 65 74 52 65 73 52 | 65 63 2e 69 58 52 73 6c |.setResR|ec.iXRsl|
|00002ec0| 20 3d 20 67 4d 61 78 44 | 50 49 3b 0d 20 20 20 20 | = gMaxD|PI;. |
|00002ed0| 09 09 73 65 74 52 65 73 | 52 65 63 2e 69 59 52 73 |..setRes|Rec.iYRs|
|00002ee0| 6c 20 3d 20 67 4d 61 78 | 44 50 49 3b 0d 20 20 20 |l = gMax|DPI;. |
|00002ef0| 20 20 20 20 20 20 0d 20 | 09 09 09 50 72 47 65 6e | . |...PrGen|
|00002f00| 65 72 61 6c 20 28 28 50 | 74 72 29 28 26 73 65 74 |eral ((P|tr)(&set|
|00002f10| 52 65 73 52 65 63 29 29 | 3b 09 0d 09 20 20 09 20 |ResRec))|;... . |
|00002f20| 7d 0d 09 20 20 7d 0d 09 | 20 2f 2f 09 20 49 66 20 |}.. }..| //. If |
|00002f30| 74 68 65 20 63 75 72 72 | 65 6e 74 20 70 72 69 6e |the curr|ent prin|
|00002f40| 74 65 72 20 64 72 69 76 | 65 72 20 64 6f 65 73 20 |ter driv|er does |
|00002f50| 4e 4f 54 20 73 75 70 70 | 6f 72 74 20 47 65 74 52 |NOT supp|ort GetR|
|00002f60| 73 6c 44 61 74 61 20 73 | 65 74 20 74 68 65 20 66 |slData s|et the f|
|00002f70| 6c 61 67 0d 09 20 2f 2f | 20 20 61 6e 64 20 72 65 |lag.. //| and re|
|00002f80| 74 75 72 6e 20 30 2c 20 | 77 68 69 63 68 20 74 65 |turn 0, |which te|
|00002f90| 6c 6c 73 20 74 68 65 20 | 63 61 6c 6c 69 6e 67 20 |lls the |calling |
|00002fa0| 66 75 6e 63 74 69 6f 6e | 20 74 6f 20 75 73 65 20 |function| to use |
|00002fb0| 61 20 73 63 61 6c 65 20 | 66 61 63 74 6f 72 20 6f |a scale |factor o|
|00002fc0| 66 20 31 2e 0d 20 09 0d | 09 20 65 6c 73 65 20 69 |f 1.. ..|. else i|
|00002fd0| 66 20 28 67 65 74 52 65 | 73 52 65 63 2e 69 45 72 |f (getRe|sRec.iEr|
|00002fe0| 72 6f 72 20 3d 3d 20 4f | 70 4e 6f 74 49 6d 70 6c |ror == O|pNotImpl|
|00002ff0| 29 20 20 20 0d 09 20 20 | 20 20 20 20 20 7b 0d 09 |) .. | {..|
|00003000| 09 20 20 20 20 20 67 53 | 65 74 52 73 6c 4f 70 49 |. gS|etRslOpI|
|00003010| 6d 70 6c 20 3d 20 66 61 | 6c 73 65 3b 0d 09 09 20 |mpl = fa|lse;... |
|00003020| 20 20 20 20 72 65 74 75 | 72 6e 20 28 30 29 3b 0d | retu|rn (0);.|
|00003030| 09 09 20 20 20 7d 0d 20 | 20 20 20 20 20 20 20 20 |.. }. | |
|00003040| 20 65 6c 73 65 20 41 6c | 65 72 74 55 73 65 72 20 | else Al|ertUser |
|00003050| 28 29 3b 20 0d 0d 0d 20 | 09 2f 2f 09 49 66 20 6f |(); ... |.//.If o|
|00003060| 75 72 20 63 61 6c 6c 20 | 74 6f 20 53 65 74 52 73 |ur call |to SetRs|
|00003070| 6c 20 77 6f 72 6b 65 64 | 20 72 65 74 75 72 6e 20 |l worked| return |
|00003080| 74 68 65 20 22 6e 65 77 | 22 20 72 65 73 6f 6c 75 |the "new|" resolu|
|00003090| 74 69 6f 6e 2c 20 6f 74 | 68 65 72 77 69 73 65 0d |tion, ot|herwise.|
|000030a0| 09 2f 2f 09 63 68 65 63 | 6b 20 74 6f 20 73 65 65 |.//.chec|k to see|
|000030b0| 20 69 66 20 74 68 69 73 | 20 6f 70 63 6f 64 65 20 | if this| opcode |
|000030c0| 69 73 20 69 6d 70 6c 65 | 6d 65 6e 74 65 64 2e 20 |is imple|mented. |
|000030d0| 20 49 66 20 69 74 20 69 | 73 20 6e 6f 74 20 72 65 | If it i|s not re|
|000030e0| 74 75 72 6e 20 30 20 0d | 09 2f 2f 09 61 6e 64 20 |turn 0 .|.//.and |
|000030f0| 73 65 74 20 6f 75 72 20 | 53 65 74 52 73 6c 4f 70 |set our |SetRslOp|
|00003100| 49 6d 70 6c 20 66 6c 61 | 67 20 74 6f 20 66 61 6c |Impl fla|g to fal|
|00003110| 73 65 2e 20 20 0d 09 0d | 09 69 66 20 28 73 65 74 |se. ...|.if (set|
|00003120| 52 65 73 52 65 63 2e 69 | 45 72 72 6f 72 20 3d 3d |ResRec.i|Error ==|
|00003130| 20 6e 6f 45 72 72 20 26 | 26 20 50 72 45 72 72 6f | noErr &|& PrErro|
|00003140| 72 28 29 20 3d 3d 20 6e | 6f 45 72 72 20 26 26 20 |r() == n|oErr && |
|00003150| 67 4d 61 78 44 50 49 20 | 21 3d 20 30 29 0d 09 20 |gMaxDPI |!= 0).. |
|00003160| 20 09 72 65 74 75 72 6e | 20 28 67 4d 61 78 44 50 | .return| (gMaxDP|
|00003170| 49 29 3b 0d 09 65 6c 73 | 65 20 69 66 20 28 73 65 |I);..els|e if (se|
|00003180| 74 52 65 73 52 65 63 2e | 69 45 72 72 6f 72 20 3d |tResRec.|iError =|
|00003190| 3d 20 4f 70 4e 6f 74 49 | 6d 70 6c 20 26 26 20 50 |= OpNotI|mpl && P|
|000031a0| 72 45 72 72 6f 72 28 29 | 20 3d 3d 20 6e 6f 45 72 |rError()| == noEr|
|000031b0| 72 29 0d 09 20 20 20 20 | 20 20 20 7b 0d 09 20 20 |r).. | {.. |
|000031c0| 20 20 20 20 20 20 20 67 | 53 65 74 52 73 6c 4f 70 | g|SetRslOp|
|000031d0| 49 6d 70 6c 20 3d 20 66 | 61 6c 73 65 3b 0d 09 09 |Impl = f|alse;...|
|000031e0| 20 20 20 20 20 72 65 74 | 75 72 6e 20 28 30 29 3b | ret|urn (0);|
|000031f0| 0d 09 09 20 20 20 7d 0d | 09 09 20 65 6c 73 65 20 |... }.|.. else |
|00003200| 72 65 74 75 72 6e 20 28 | 30 29 3b 0d 0d 7d 20 20 |return (|0);..} |
|00003210| 20 20 2f 2f 20 20 65 6e | 64 20 6f 66 20 73 65 74 | // en|d of set|
|00003220| 4d 61 78 52 65 73 6f 6c | 75 74 69 6f 6e 0d 0d 0d |MaxResol|ution...|
|00003230| 0d 09 0d 2f 2f 2d 2d 2d | 2d 2d 2d 20 64 6f 53 65 |...//---|--- doSe|
|00003240| 74 52 73 6c 20 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |tRsl ---|--------|
|00003250| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00003260| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00003270| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00003280| 2d 2d 2d 2d 2d 2d 2d 2d | 0d 2f 2f 0d 2f 2f 20 20 |--------|.//.// |
|00003290| 64 6f 53 65 74 52 73 6c | 20 69 73 20 74 68 65 20 |doSetRsl| is the |
|000032a0| 63 61 6c 6c 69 6e 67 20 | 66 75 6e 63 74 69 6f 6e |calling |function|
|000032b0| 20 74 68 61 74 20 63 61 | 6c 6c 73 20 73 65 74 4d | that ca|lls setM|
|000032c0| 61 78 52 65 73 6f 6c 75 | 74 69 6f 6e 2e 20 20 73 |axResolu|tion. s|
|000032d0| 65 74 4d 61 78 52 65 73 | 6f 6c 75 74 69 6f 6e 0d |etMaxRes|olution.|
|000032e0| 2f 2f 09 77 69 6c 6c 20 | 72 65 74 75 72 6e 20 74 |//.will |return t|
|000032f0| 68 65 20 6d 61 78 69 6d | 75 6d 20 72 65 73 6f 6c |he maxim|um resol|
|00003300| 75 74 69 6f 6e 20 74 68 | 61 74 20 69 73 20 73 75 |ution th|at is su|
|00003310| 70 70 6f 72 74 65 64 20 | 62 79 20 74 68 65 20 63 |pported |by the c|
|00003320| 75 72 72 65 6e 74 20 70 | 72 69 6e 74 65 72 0d 2f |urrent p|rinter./|
|00003330| 2f 09 64 72 69 76 65 72 | 2e 20 20 57 69 74 68 20 |/.driver|. With |
|00003340| 74 68 69 73 20 64 65 76 | 69 63 65 20 72 65 73 6f |this dev|ice reso|
|00003350| 6c 75 74 69 6f 6e 20 28 | 64 65 76 69 63 65 52 65 |lution (|deviceRe|
|00003360| 73 29 2c 20 77 65 20 77 | 69 6c 6c 20 74 68 65 6e |s), we w|ill then|
|00003370| 20 64 65 74 65 72 6d 69 | 6e 65 20 74 68 65 20 73 | determi|ne the s|
|00003380| 63 61 6c 65 0d 2f 2f 09 | 66 61 63 74 6f 72 20 74 |cale.//.|factor t|
|00003390| 68 61 74 20 6d 75 73 74 | 20 62 65 20 75 73 65 64 |hat must| be used|
|000033a0| 20 6f 6e 20 61 6c 6c 20 | 6f 66 20 6f 75 72 20 63 | on all |of our c|
|000033b0| 6f 6f 72 64 69 6e 61 74 | 65 73 20 61 6e 64 20 66 |oordinat|es and f|
|000033c0| 6f 6e 74 20 73 69 7a 65 | 73 2c 20 6f 74 68 65 72 |ont size|s, other|
|000033d0| 77 69 73 65 0d 2f 2f 09 | 77 65 20 77 69 6c 6c 20 |wise.//.|we will |
|000033e0| 72 65 63 65 69 76 65 20 | 22 6d 69 63 72 6f 22 20 |receive |"micro" |
|000033f0| 74 65 78 74 20 61 6e 64 | 20 69 6d 61 67 65 73 2e |text and| images.|
|00003400| 20 20 49 66 20 73 65 74 | 4d 61 78 72 65 73 6f 6c | If set|Maxresol|
|00003410| 75 74 69 6f 6e 20 72 65 | 74 75 72 6e 73 20 30 2c |ution re|turns 0,|
|00003420| 20 69 74 20 6d 65 61 6e | 73 20 0d 2f 2f 09 74 68 | it mean|s .//.th|
|00003430| 61 74 20 53 65 74 52 73 | 6c 20 61 6e 64 20 47 65 |at SetRs|l and Ge|
|00003440| 74 52 73 6c 44 61 74 61 | 20 61 72 65 20 6e 6f 74 |tRslData| are not|
|00003450| 20 73 75 70 70 6f 72 74 | 65 64 20 6f 72 20 61 6e | support|ed or an|
|00003460| 20 65 72 72 6f 72 20 6f | 63 63 75 72 72 65 64 2e | error o|ccurred.|
|00003470| 20 20 57 65 20 77 69 6c | 6c 20 74 68 65 6e 0d 2f | We wil|l then./|
|00003480| 2f 09 75 73 65 20 61 20 | 73 63 61 6c 65 20 66 61 |/.use a |scale fa|
|00003490| 63 74 6f 72 20 6f 66 20 | 31 2e 0d 2f 2f 0d 0d 76 |ctor of |1..//..v|
|000034a0| 6f 69 64 20 64 6f 53 65 | 74 52 73 6c 20 28 29 0d |oid doSe|tRsl ().|
|000034b0| 7b 0d 09 73 68 6f 72 74 | 09 09 64 65 76 69 63 65 |{..short|..device|
|000034c0| 52 65 73 3b 0d 09 47 72 | 61 66 50 74 72 09 09 6f |Res;..Gr|afPtr..o|
|000034d0| 6c 64 50 6f 72 74 3b 0d | 09 0d 09 47 65 74 50 6f |ldPort;.|...GetPo|
|000034e0| 72 74 20 28 26 6f 6c 64 | 50 6f 72 74 29 3b 0d 0d |rt (&old|Port);..|
|000034f0| 09 64 65 76 69 63 65 52 | 65 73 20 3d 20 73 65 74 |.deviceR|es = set|
|00003500| 4d 61 78 52 65 73 6f 6c | 75 74 69 6f 6e 20 28 29 |MaxResol|ution ()|
|00003510| 3b 0d 20 20 20 20 20 0d | 09 2f 2f 09 49 66 20 64 |;. .|.//.If d|
|00003520| 65 76 69 63 65 52 65 73 | 20 69 73 20 6e 6f 74 20 |eviceRes| is not |
|00003530| 7a 65 72 6f 2c 20 77 65 | 20 77 69 6c 6c 20 64 65 |zero, we| will de|
|00003540| 74 65 72 6d 69 6e 65 20 | 74 68 65 20 73 63 61 6c |termine |the scal|
|00003550| 65 20 66 61 63 74 6f 72 | 20 74 68 61 74 0d 09 2f |e factor| that../|
|00003560| 2f 09 4d 55 53 54 20 62 | 65 20 75 73 65 64 20 6f |/.MUST b|e used o|
|00003570| 6e 20 61 6c 6c 20 6f 66 | 20 6f 75 72 20 63 6f 6f |n all of| our coo|
|00003580| 72 64 69 6e 61 74 65 73 | 20 61 6e 64 20 66 6f 6e |rdinates| and fon|
|00003590| 74 20 73 69 7a 65 73 2e | 20 20 49 66 20 77 65 20 |t sizes.| If we |
|000035a0| 64 6f 20 0d 09 2f 2f 09 | 4e 4f 54 20 73 63 61 6c |do ..//.|NOT scal|
|000035b0| 65 20 74 68 65 73 65 20 | 69 74 65 6d 73 2c 20 77 |e these |items, w|
|000035c0| 65 20 77 69 6c 6c 20 67 | 65 74 20 74 68 65 20 22 |e will g|et the "|
|000035d0| 6d 69 63 72 6f 22 20 74 | 65 78 74 20 61 6e 64 20 |micro" t|ext and |
|000035e0| 69 6d 61 67 65 73 2e 2e | 2e 0d 09 0d 20 20 20 20 |images..|.... |
|000035f0| 69 66 20 28 64 65 76 69 | 63 65 52 65 73 20 21 3d |if (devi|ceRes !=|
|00003600| 20 30 29 20 67 53 63 61 | 6c 65 20 3d 20 64 65 76 | 0) gSca|le = dev|
|00003610| 69 63 65 52 65 73 20 2f | 20 4d 61 63 53 63 72 65 |iceRes /| MacScre|
|00003620| 65 6e 52 65 73 3b 0d 0d | 09 53 65 74 50 6f 72 74 |enRes;..|.SetPort|
|00003630| 20 28 6f 6c 64 50 6f 72 | 74 29 3b 0d 0d 7d 09 2f | (oldPor|t);..}./|
|00003640| 2f 09 20 65 6e 64 20 6f | 66 20 64 6f 53 65 74 52 |/. end o|f doSetR|
|00003650| 73 6c 0d 0d 0d 0d 0d 2f | 2f 2d 2d 2d 2d 2d 2d 20 |sl...../|/------ |
|00003660| 64 6f 44 72 61 66 74 42 | 69 74 73 20 2d 2d 2d 2d |doDraftB|its ----|
|00003670| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00003680| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00003690| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|000036a0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 0d 2f 2f 0d |--------|----.//.|
|000036b0| 2f 2f 09 64 6f 44 72 61 | 66 74 42 69 74 73 20 77 |//.doDra|ftBits w|
|000036c0| 69 6c 6c 20 73 65 74 20 | 74 68 65 20 64 72 61 66 |ill set |the draf|
|000036d0| 74 42 69 74 73 4f 70 20 | 6f 70 63 6f 64 65 20 66 |tBitsOp |opcode f|
|000036e0| 6f 72 20 74 68 65 20 63 | 75 72 72 65 6e 74 20 70 |or the c|urrent p|
|000036f0| 72 69 6e 74 65 72 20 64 | 72 69 76 65 72 2e 20 20 |rinter d|river. |
|00003700| 49 66 20 74 68 65 20 0d | 2f 2f 09 63 75 72 72 65 |If the .|//.curre|
|00003710| 6e 74 20 70 72 69 6e 74 | 65 72 20 64 72 69 76 65 |nt print|er drive|
|00003720| 72 20 64 6f 65 73 20 4e | 4f 54 20 73 75 70 70 6f |r does N|OT suppo|
|00003730| 72 74 20 74 68 69 73 20 | 6f 70 63 6f 64 65 2c 20 |rt this |opcode, |
|00003740| 77 65 20 77 69 6c 6c 20 | 73 65 74 20 74 68 65 20 |we will |set the |
|00003750| 67 44 72 61 66 74 42 69 | 74 73 4f 70 49 6d 70 6c |gDraftBi|tsOpImpl|
|00003760| 0d 2f 2f 09 66 6c 61 67 | 20 74 6f 20 66 61 6c 73 |.//.flag| to fals|
|00003770| 65 20 77 68 69 63 68 20 | 77 69 6c 6c 20 70 72 65 |e which |will pre|
|00003780| 76 65 6e 74 20 74 68 69 | 73 20 66 75 6e 63 74 69 |vent thi|s functi|
|00003790| 6f 6e 20 66 72 6f 6d 20 | 62 65 69 6e 67 20 63 61 |on from |being ca|
|000037a0| 6c 6c 65 64 2e 20 20 49 | 66 20 61 6e 79 20 65 72 |lled. I|f any er|
|000037b0| 72 6f 72 20 6f 63 63 75 | 72 73 2c 0d 2f 2f 09 77 |ror occu|rs,.//.w|
|000037c0| 65 20 77 69 6c 6c 20 61 | 6c 65 72 74 20 74 68 65 |e will a|lert the|
|000037d0| 20 75 73 65 72 20 76 69 | 61 20 74 68 65 20 41 6c | user vi|a the Al|
|000037e0| 65 72 74 55 73 65 72 20 | 66 75 6e 63 74 69 6f 6e |ertUser |function|
|000037f0| 2e 0d 2f 2f 0d 0d 76 6f | 69 64 20 64 6f 44 72 61 |..//..vo|id doDra|
|00003800| 66 74 42 69 74 73 20 28 | 29 0d 7b 0d 09 54 44 66 |ftBits (|).{..TDf|
|00003810| 74 42 69 74 73 42 6c 6b | 09 09 64 72 61 66 74 42 |tBitsBlk|..draftB|
|00003820| 69 74 73 42 6c 6b 3b 0d | 0d 09 67 44 72 61 66 74 |itsBlk;.|..gDraft|
|00003830| 42 69 74 73 48 61 73 42 | 65 65 6e 53 65 74 20 3d |BitsHasB|eenSet =|
|00003840| 20 74 72 75 65 3b 0d 0d | 20 20 20 20 2f 2f 20 20 | true;..| // |
|00003850| 53 65 74 20 74 68 65 20 | 64 72 61 66 74 42 69 74 |Set the |draftBit|
|00003860| 73 4f 70 20 61 6e 64 20 | 75 70 64 61 74 65 20 74 |sOp and |update t|
|00003870| 68 65 20 63 6f 6e 74 65 | 6e 74 73 20 6f 66 20 74 |he conte|nts of t|
|00003880| 68 65 20 70 72 69 6e 74 | 20 68 61 6e 64 6c 65 2e |he print| handle.|
|00003890| 0d 09 0d 09 64 72 61 66 | 74 42 69 74 73 42 6c 6b |....draf|tBitsBlk|
|000038a0| 2e 69 4f 70 43 6f 64 65 | 20 3d 20 64 72 61 66 74 |.iOpCode| = draft|
|000038b0| 42 69 74 73 4f 70 3b 0d | 09 64 72 61 66 74 42 69 |BitsOp;.|.draftBi|
|000038c0| 74 73 42 6c 6b 2e 68 50 | 72 69 6e 74 20 3d 20 67 |tsBlk.hP|rint = g|
|000038d0| 50 72 52 65 63 48 64 6c | 3b 0d 09 50 72 47 65 6e |PrRecHdl|;..PrGen|
|000038e0| 65 72 61 6c 28 28 50 74 | 72 29 20 26 64 72 61 66 |eral((Pt|r) &draf|
|000038f0| 74 42 69 74 73 42 6c 6b | 29 3b 0d 0d 09 2f 2f 20 |tBitsBlk|);...// |
|00003900| 20 54 68 65 20 64 72 61 | 66 74 42 69 74 73 20 6f | The dra|ftBits o|
|00003910| 70 63 6f 64 65 20 69 73 | 20 4e 4f 54 20 73 75 70 |pcode is| NOT sup|
|00003920| 70 6f 72 74 65 64 20 62 | 79 20 74 68 65 20 63 75 |ported b|y the cu|
|00003930| 72 72 65 6e 74 20 70 72 | 69 6e 74 65 72 20 64 72 |rrent pr|inter dr|
|00003940| 69 76 65 72 2c 0d 09 2f | 2f 20 20 74 68 65 72 65 |iver,../|/ there|
|00003950| 66 6f 72 65 20 77 65 20 | 77 69 6c 6c 20 73 65 74 |fore we |will set|
|00003960| 20 74 68 65 20 64 72 61 | 66 74 42 69 74 73 20 6f | the dra|ftBits o|
|00003970| 70 63 6f 64 65 20 69 6d | 70 6c 65 6d 65 6e 74 65 |pcode im|plemente|
|00003980| 64 20 66 6c 61 67 20 74 | 6f 20 66 61 6c 73 65 2e |d flag t|o false.|
|00003990| 0d 09 2f 2f 20 20 57 68 | 69 63 68 20 77 69 6c 6c |..// Wh|ich will|
|000039a0| 20 70 72 65 76 65 6e 74 | 20 74 68 69 73 20 66 75 | prevent| this fu|
|000039b0| 6e 63 74 69 6f 6e 20 66 | 72 6f 6d 20 62 65 69 6e |nction f|rom bein|
|000039c0| 67 20 63 61 6c 6c 65 64 | 20 75 6e 74 69 6c 20 61 |g called| until a|
|000039d0| 20 6e 65 77 20 70 72 69 | 6e 74 65 72 20 0d 09 2f | new pri|nter ../|
|000039e0| 2f 20 20 69 73 20 73 65 | 6c 65 63 74 65 64 20 76 |/ is se|lected v|
|000039f0| 69 61 20 74 68 65 20 43 | 68 6f 6f 73 65 72 2e 20 |ia the C|hooser. |
|00003a00| 20 49 66 20 61 6e 6f 74 | 68 65 72 20 74 79 70 65 | If anot|her type|
|00003a10| 20 6f 66 20 65 72 72 6f | 72 20 6f 63 63 75 72 72 | of erro|r occurr|
|00003a20| 65 64 20 72 65 70 6f 72 | 74 0d 09 2f 2f 20 20 69 |ed repor|t..// i|
|00003a30| 74 20 74 6f 20 74 68 65 | 20 75 73 65 72 20 76 69 |t to the| user vi|
|00003a40| 61 20 41 6c 65 72 74 55 | 73 65 72 2e 0d 0d 09 69 |a AlertU|ser....i|
|00003a50| 66 20 28 64 72 61 66 74 | 42 69 74 73 42 6c 6b 2e |f (draft|BitsBlk.|
|00003a60| 69 45 72 72 6f 72 20 3d | 3d 20 4f 70 4e 6f 74 49 |iError =|= OpNotI|
|00003a70| 6d 70 6c 20 26 26 20 50 | 72 45 72 72 6f 72 28 29 |mpl && P|rError()|
|00003a80| 20 3d 3d 20 6e 6f 45 72 | 72 29 0d 09 20 20 67 44 | == noEr|r).. gD|
|00003a90| 72 61 66 74 42 69 74 73 | 4f 70 49 6d 70 6c 20 20 |raftBits|OpImpl |
|00003aa0| 3d 20 66 61 6c 73 65 3b | 20 0d 09 65 6c 73 65 20 |= false;| ..else |
|00003ab0| 69 66 20 28 64 72 61 66 | 74 42 69 74 73 42 6c 6b |if (draf|tBitsBlk|
|00003ac0| 2e 69 45 72 72 6f 72 20 | 21 3d 20 6e 6f 45 72 72 |.iError |!= noErr|
|00003ad0| 20 7c 7c 20 50 72 45 72 | 72 6f 72 28 29 20 21 3d | || PrEr|ror() !=|
|00003ae0| 20 6e 6f 45 72 72 29 0d | 20 20 20 20 20 20 20 20 | noErr).| |
|00003af0| 20 20 20 41 6c 65 72 74 | 55 73 65 72 20 28 29 3b | Alert|User ();|
|00003b00| 0d 09 20 0d 7d 20 20 2f | 2f 20 65 6e 64 20 6f 66 |.. .} /|/ end of|
|00003b10| 20 64 6f 44 72 61 66 74 | 42 69 74 73 0d 0d 0d 0d | doDraft|Bits....|
|00003b20| 0d 2f 2f 2d 2d 2d 2d 2d | 2d 20 64 6f 4e 4f 44 72 |.//-----|- doNODr|
|00003b30| 61 66 74 42 69 74 73 20 | 2d 2d 2d 2d 2d 2d 2d 2d |aftBits |--------|
|00003b40| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00003b50| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00003b60| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00003b70| 2d 2d 2d 2d 2d 2d 2d 0d | 2f 2f 0d 2f 2f 09 64 6f |-------.|//.//.do|
|00003b80| 4e 4f 44 72 61 66 74 42 | 69 74 73 20 77 69 6c 6c |NODraftB|its will|
|00003b90| 20 75 6e 64 6f 20 74 68 | 65 20 63 61 6c 6c 20 74 | undo th|e call t|
|00003ba0| 6f 20 73 65 74 20 74 68 | 65 20 64 72 61 66 74 42 |o set th|e draftB|
|00003bb0| 69 74 73 4f 70 20 6f 70 | 63 6f 64 65 2e 20 20 54 |itsOp op|code. T|
|00003bc0| 68 69 73 20 66 75 6e 63 | 74 69 6f 6e 20 63 61 6e |his func|tion can|
|00003bd0| 0d 2f 2f 20 20 4e 4f 54 | 20 62 65 20 63 61 6c 6c |.// NOT| be call|
|00003be0| 65 64 20 69 66 20 64 6f | 44 72 61 66 74 42 69 74 |ed if do|DraftBit|
|00003bf0| 73 20 77 61 73 20 6e 6f | 74 20 63 61 6c 6c 65 64 |s was no|t called|
|00003c00| 20 6f 72 20 74 68 69 73 | 20 6f 70 63 6f 64 65 20 | or this| opcode |
|00003c10| 69 73 20 6e 6f 74 20 73 | 75 70 70 6f 72 74 65 64 |is not s|upported|
|00003c20| 20 62 79 20 74 68 65 20 | 0d 2f 2f 09 63 75 72 72 | by the |.//.curr|
|00003c30| 65 6e 74 20 70 72 69 6e | 74 65 72 20 64 72 69 76 |ent prin|ter driv|
|00003c40| 65 72 2e 20 20 54 68 69 | 73 20 66 75 6e 63 74 69 |er. Thi|s functi|
|00003c50| 6f 6e 20 62 65 68 61 76 | 65 73 20 69 6e 20 74 68 |on behav|es in th|
|00003c60| 65 20 73 61 6d 65 20 6d | 61 6e 6e 65 72 20 61 73 |e same m|anner as|
|00003c70| 20 64 65 73 63 72 69 62 | 65 64 20 61 62 6f 76 65 | describ|ed above|
|00003c80| 0d 2f 2f 20 20 66 6f 72 | 20 64 6f 44 72 61 66 74 |.// for| doDraft|
|00003c90| 42 69 74 73 2e 0d 2f 2f | 0d 0d 76 6f 69 64 20 64 |Bits..//|..void d|
|00003ca0| 6f 4e 4f 44 72 61 66 74 | 42 69 74 73 20 28 29 0d |oNODraft|Bits ().|
|00003cb0| 7b 0d 09 54 44 66 74 42 | 69 74 73 42 6c 6b 09 09 |{..TDftB|itsBlk..|
|00003cc0| 64 72 61 66 74 42 69 74 | 73 42 6c 6b 3b 0d 0d 09 |draftBit|sBlk;...|
|00003cd0| 64 72 61 66 74 42 69 74 | 73 42 6c 6b 2e 69 4f 70 |draftBit|sBlk.iOp|
|00003ce0| 43 6f 64 65 20 3d 20 6e | 6f 44 72 61 66 74 42 69 |Code = n|oDraftBi|
|00003cf0| 74 73 4f 70 3b 0d 09 64 | 72 61 66 74 42 69 74 73 |tsOp;..d|raftBits|
|00003d00| 42 6c 6b 2e 68 50 72 69 | 6e 74 20 3d 20 67 50 72 |Blk.hPri|nt = gPr|
|00003d10| 52 65 63 48 64 6c 3b 0d | 09 50 72 47 65 6e 65 72 |RecHdl;.|.PrGener|
|00003d20| 61 6c 28 28 50 74 72 29 | 20 26 64 72 61 66 74 42 |al((Ptr)| &draftB|
|00003d30| 69 74 73 42 6c 6b 29 3b | 0d 0d 09 69 66 20 28 64 |itsBlk);|...if (d|
|00003d40| 72 61 66 74 42 69 74 73 | 42 6c 6b 2e 69 45 72 72 |raftBits|Blk.iErr|
|00003d50| 6f 72 20 21 3d 20 6e 6f | 45 72 72 20 7c 7c 20 50 |or != no|Err || P|
|00003d60| 72 45 72 72 6f 72 28 29 | 20 21 3d 20 6e 6f 45 72 |rError()| != noEr|
|00003d70| 72 29 0d 20 20 20 20 20 | 20 20 41 6c 65 72 74 55 |r). | AlertU|
|00003d80| 73 65 72 20 28 29 3b 0d | 0d 7d 20 20 2f 2f 20 65 |ser ();.|.} // e|
|00003d90| 6e 64 20 6f 66 20 64 6f | 4e 4f 44 72 61 66 74 42 |nd of do|NODraftB|
|00003da0| 69 74 73 0d 0d 0d 0d 0d | 2f 2f 2d 2d 2d 2d 2d 2d |its.....|//------|
|00003db0| 20 53 68 6f 77 4c 61 6e | 64 73 63 61 70 65 52 65 | ShowLan|dscapeRe|
|00003dc0| 73 75 6c 74 73 20 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |sults --|--------|
|00003dd0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00003de0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00003df0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 0d 2f |--------|------./|
|00003e00| 2f 0d 2f 2f 09 54 68 69 | 73 20 72 6f 75 74 69 6e |/.//.Thi|s routin|
|00003e10| 65 20 77 69 6c 6c 20 73 | 68 6f 77 20 74 68 65 20 |e will s|how the |
|00003e20| 72 65 73 75 6c 74 73 20 | 76 69 61 20 61 20 64 69 |results |via a di|
|00003e30| 61 6c 6f 67 20 6f 66 20 | 74 68 65 20 49 73 4c 61 |alog of |the IsLa|
|00003e40| 6e 64 73 63 61 70 65 53 | 65 74 20 66 75 6e 63 74 |ndscapeS|et funct|
|00003e50| 69 6f 6e 2e 0d 2f 2f 0d | 0d 76 6f 69 64 20 53 68 |ion..//.|.void Sh|
|00003e60| 6f 77 4c 61 6e 64 73 63 | 61 70 65 52 65 73 75 6c |owLandsc|apeResul|
|00003e70| 74 73 20 28 42 6f 6f 6c | 65 61 6e 20 72 65 73 75 |ts (Bool|ean resu|
|00003e80| 6c 74 29 0d 0d 7b 0d 20 | 20 09 73 68 6f 72 74 09 |lt)..{. | .short.|
|00003e90| 09 09 69 74 65 6d 48 69 | 74 3b 0d 20 20 09 53 74 |..itemHi|t;. .St|
|00003ea0| 72 69 6e 67 48 61 6e 64 | 6c 65 09 64 69 73 70 6c |ringHand|le.displ|
|00003eb0| 61 79 4d 65 73 73 61 67 | 65 3b 0d 20 20 09 53 74 |ayMessag|e;. .St|
|00003ec0| 72 32 35 35 09 09 09 64 | 69 73 70 6c 61 79 4d 65 |r255...d|isplayMe|
|00003ed0| 73 73 61 67 65 53 74 72 | 69 6e 67 3b 0d 20 20 0d |ssageStr|ing;. .|
|00003ee0| 20 20 09 53 65 74 43 75 | 72 73 6f 72 28 26 71 64 | .SetCu|rsor(&qd|
|00003ef0| 2e 61 72 72 6f 77 29 3b | 0d 20 20 0d 20 20 09 69 |.arrow);|. . .i|
|00003f00| 66 20 28 72 65 73 75 6c | 74 29 20 20 0d 20 20 20 |f (resul|t) . |
|00003f10| 20 20 20 64 69 73 70 6c | 61 79 4d 65 73 73 61 67 | displ|ayMessag|
|00003f20| 65 20 3d 20 47 65 74 53 | 74 72 69 6e 67 20 28 32 |e = GetS|tring (2|
|00003f30| 30 31 29 3b 0d 20 20 20 | 20 65 6c 73 65 0d 09 20 |01);. | else.. |
|00003f40| 20 64 69 73 70 6c 61 79 | 4d 65 73 73 61 67 65 20 | display|Message |
|00003f50| 3d 20 47 65 74 53 74 72 | 69 6e 67 20 28 32 30 32 |= GetStr|ing (202|
|00003f60| 29 3b 0d 09 0d 09 0d 20 | 20 20 09 69 66 20 28 64 |);..... | .if (d|
|00003f70| 69 73 70 6c 61 79 4d 65 | 73 73 61 67 65 20 21 3d |isplayMe|ssage !=|
|00003f80| 20 6e 69 6c 29 0d 09 20 | 20 42 6c 6f 63 6b 4d 6f | nil).. | BlockMo|
|00003f90| 76 65 28 2a 64 69 73 70 | 6c 61 79 4d 65 73 73 61 |ve(*disp|layMessa|
|00003fa0| 67 65 2c 20 26 64 69 73 | 70 6c 61 79 4d 65 73 73 |ge, &dis|playMess|
|00003fb0| 61 67 65 53 74 72 69 6e | 67 2c 20 28 6c 6f 6e 67 |ageStrin|g, (long|
|00003fc0| 29 2a 64 69 73 70 6c 61 | 79 4d 65 73 73 61 67 65 |)*displa|yMessage|
|00003fd0| 5b 30 5d 2b 31 4c 29 3b | 0d 20 09 65 6c 73 65 0d |[0]+1L);|. .else.|
|00003fe0| 20 20 20 20 20 20 20 41 | 6c 65 72 74 55 73 65 72 | A|lertUser|
|00003ff0| 28 29 3b 0d 09 20 20 20 | 0d 20 20 20 20 50 61 72 |();.. |. Par|
|00004000| 61 6d 54 65 78 74 20 28 | 64 69 73 70 6c 61 79 4d |amText (|displayM|
|00004010| 65 73 73 61 67 65 53 74 | 72 69 6e 67 2c 20 22 5c |essageSt|ring, "\|
|00004020| 70 20 22 2c 20 22 5c 70 | 20 22 2c 20 22 5c 70 20 |p ", "\p| ", "\p |
|00004030| 22 29 3b 0d 09 0d 09 69 | 74 65 6d 48 69 74 20 3d |");....i|temHit =|
|00004040| 20 4e 6f 74 65 41 6c 65 | 72 74 28 72 4c 61 6e 64 | NoteAle|rt(rLand|
|00004050| 73 63 61 70 65 41 6c 65 | 72 74 2c 20 6e 69 6c 29 |scapeAle|rt, nil)|
|00004060| 3b 0d 09 0d 7d 09 2f 2f | 20 20 65 6e 64 20 6f 66 |;...}.//| end of|
|00004070| 20 53 68 6f 77 4c 61 6e | 64 73 63 61 70 65 52 65 | ShowLan|dscapeRe|
|00004080| 73 75 6c 74 73 0d 0d 0d | 0d 0d 2f 2f 2d 2d 2d 2d |sults...|..//----|
|00004090| 2d 2d 20 49 73 4c 61 6e | 64 73 63 61 70 65 53 65 |-- IsLan|dscapeSe|
|000040a0| 74 20 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |t ------|--------|
|000040b0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|000040c0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|000040d0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 0d |--------|-------.|
|000040e0| 2f 2f 0d 2f 2f 09 49 73 | 4c 61 6e 64 73 63 61 70 |//.//.Is|Landscap|
|000040f0| 65 53 65 74 20 77 69 6c | 6c 20 64 65 74 65 72 6d |eSet wil|l determ|
|00004100| 69 6e 65 20 69 66 20 74 | 68 65 20 75 73 65 72 20 |ine if t|he user |
|00004110| 68 61 73 20 73 65 6c 65 | 63 74 65 64 20 6c 61 6e |has sele|cted lan|
|00004120| 64 73 63 61 70 65 20 6f | 72 69 65 6e 74 61 74 69 |dscape o|rientati|
|00004130| 6f 6e 20 0d 2f 2f 09 66 | 72 6f 6d 20 74 68 65 20 |on .//.f|rom the |
|00004140| 53 74 79 6c 65 20 64 69 | 61 6c 6f 67 2e 20 49 66 |Style di|alog. If|
|00004150| 20 74 68 65 20 75 73 65 | 72 20 68 61 73 20 73 65 | the use|r has se|
|00004160| 6c 65 63 74 65 64 20 6c | 61 6e 64 73 63 61 70 65 |lected l|andscape|
|00004170| 20 6f 72 69 65 6e 74 61 | 74 69 6f 6e 2c 20 77 65 | orienta|tion, we|
|00004180| 20 77 69 6c 6c 20 0d 2f | 2f 09 72 65 74 75 72 6e | will ./|/.return|
|00004190| 20 22 74 72 75 65 22 20 | 74 6f 20 74 68 65 20 63 | "true" |to the c|
|000041a0| 61 6c 6c 69 6e 67 20 66 | 75 6e 63 74 69 6f 6e 2e |alling f|unction.|
|000041b0| 20 4f 74 68 65 72 77 69 | 73 65 2c 20 72 65 74 75 | Otherwi|se, retu|
|000041c0| 72 6e 20 22 66 61 6c 73 | 65 22 2e 0d 2f 2f 0d 0d |rn "fals|e"..//..|
|000041d0| 76 6f 69 64 20 49 73 4c | 61 6e 64 73 63 61 70 65 |void IsL|andscape|
|000041e0| 53 65 74 20 28 54 48 50 | 72 69 6e 74 20 74 68 65 |Set (THP|rint the|
|000041f0| 50 72 52 65 63 48 64 6c | 29 0d 0d 7b 0d 20 20 20 |PrRecHdl|)..{. |
|00004200| 09 54 47 65 74 52 6f 74 | 6e 42 6c 6b 09 47 65 74 |.TGetRot|nBlk.Get|
|00004210| 52 6f 74 52 65 63 3b 0d | 09 0d 20 20 20 09 47 65 |RotRec;.|.. .Ge|
|00004220| 74 52 6f 74 52 65 63 2e | 69 4f 70 43 6f 64 65 20 |tRotRec.|iOpCode |
|00004230| 3d 20 67 65 74 52 6f 74 | 6e 4f 70 3b 0d 20 20 09 |= getRot|nOp;. .|
|00004240| 47 65 74 52 6f 74 52 65 | 63 2e 68 50 72 69 6e 74 |GetRotRe|c.hPrint|
|00004250| 20 3d 20 74 68 65 50 72 | 52 65 63 48 64 6c 3b 0d | = thePr|RecHdl;.|
|00004260| 20 0d 20 20 09 50 72 47 | 65 6e 65 72 61 6c 20 28 | . .PrG|eneral (|
|00004270| 28 50 74 72 29 20 26 47 | 65 74 52 6f 74 52 65 63 |(Ptr) &G|etRotRec|
|00004280| 29 3b 09 0d 20 09 0d 09 | 2f 2f 20 20 49 66 20 74 |);.. ...|// If t|
|00004290| 68 65 20 6c 61 6e 64 73 | 63 61 70 65 20 6f 70 63 |he lands|cape opc|
|000042a0| 6f 64 65 20 69 73 20 4e | 4f 54 20 69 6d 70 6c 65 |ode is N|OT imple|
|000042b0| 6d 65 6e 74 65 64 20 62 | 79 20 74 68 65 20 63 75 |mented b|y the cu|
|000042c0| 72 72 65 6e 74 20 70 72 | 69 6e 74 65 72 20 64 72 |rrent pr|inter dr|
|000042d0| 69 76 65 72 2c 0d 09 2f | 2f 20 20 73 65 74 20 74 |iver,../|/ set t|
|000042e0| 68 65 20 66 6c 61 67 20 | 74 6f 20 74 72 75 65 2e |he flag |to true.|
|000042f0| 20 20 54 68 69 73 20 66 | 6c 61 67 20 77 69 6c 6c | This f|lag will|
|00004300| 20 70 72 65 65 6e 74 20 | 74 68 65 20 63 61 6c 6c | preent |the call|
|00004310| 69 6e 67 20 6f 66 20 74 | 68 69 73 20 66 75 6e 63 |ing of t|his func|
|00004320| 74 69 6f 6e 0d 09 2f 2f | 20 20 75 6e 74 69 6c 20 |tion..//| until |
|00004330| 74 68 65 20 70 72 69 6e | 74 65 72 20 64 72 69 76 |the prin|ter driv|
|00004340| 65 72 20 69 73 20 63 68 | 61 6e 67 65 64 2e 2e 2e |er is ch|anged...|
|00004350| 0d 0d 09 69 66 20 28 47 | 65 74 52 6f 74 52 65 63 |...if (G|etRotRec|
|00004360| 2e 69 45 72 72 6f 72 20 | 3d 3d 20 4f 70 4e 6f 74 |.iError |== OpNot|
|00004370| 49 6d 70 6c 29 0d 09 20 | 20 67 4c 61 6e 64 73 63 |Impl).. | gLandsc|
|00004380| 61 70 65 4f 70 49 6d 70 | 6c 20 3d 20 66 61 6c 73 |apeOpImp|l = fals|
|00004390| 65 3b 0d 09 20 20 0d 09 | 20 20 0d 09 2f 2f 09 57 |e;.. ..| ..//.W|
|000043a0| 65 20 6e 6f 77 20 68 61 | 76 65 20 74 68 65 20 72 |e now ha|ve the r|
|000043b0| 65 73 75 6c 74 20 66 72 | 6f 6d 20 6f 75 72 20 63 |esult fr|om our c|
|000043c0| 61 6c 6c 20 74 6f 20 50 | 72 47 65 6e 65 72 61 6c |all to P|rGeneral|
|000043d0| 2c 20 62 75 74 20 77 65 | 20 63 68 65 63 6b 20 61 |, but we| check a|
|000043e0| 6c 6c 0d 09 2f 2f 09 6b | 6e 6f 77 6e 20 65 72 72 |ll..//.k|nown err|
|000043f0| 6f 72 73 20 74 6f 20 6d | 61 6b 65 20 73 75 72 65 |ors to m|ake sure|
|00004400| 20 74 68 61 74 20 50 72 | 47 65 6e 65 72 61 6c 20 | that Pr|General |
|00004410| 77 61 73 20 73 75 63 63 | 65 73 73 66 75 6c 20 61 |was succ|essful a|
|00004420| 6e 64 20 74 68 65 72 65 | 0d 09 2f 2f 09 68 61 76 |nd there|..//.hav|
|00004430| 65 20 6e 6f 74 20 62 65 | 65 6e 20 61 6e 79 20 65 |e not be|en any e|
|00004440| 72 72 6f 72 73 20 65 6e | 63 6f 75 6e 74 65 72 65 |rrors en|countere|
|00004450| 64 20 66 72 6f 6d 20 70 | 72 69 6e 74 69 6e 67 20 |d from p|rinting |
|00004460| 6c 61 6e 64 2e 0d 0d 09 | 69 66 20 28 47 65 74 52 |land....|if (GetR|
|00004470| 6f 74 52 65 63 2e 69 45 | 72 72 6f 72 20 3d 3d 20 |otRec.iE|rror == |
|00004480| 6e 6f 45 72 72 20 26 26 | 20 50 72 45 72 72 6f 72 |noErr &&| PrError|
|00004490| 28 29 20 3d 3d 20 6e 6f | 45 72 72 20 26 26 20 47 |() == no|Err && G|
|000044a0| 65 74 52 6f 74 52 65 63 | 2e 66 4c 61 6e 64 73 63 |etRotRec|.fLandsc|
|000044b0| 61 70 65 29 0d 09 20 20 | 20 53 68 6f 77 4c 61 6e |ape).. | ShowLan|
|000044c0| 64 73 63 61 70 65 52 65 | 73 75 6c 74 73 20 28 74 |dscapeRe|sults (t|
|000044d0| 72 75 65 29 3b 0d 09 65 | 6c 73 65 20 69 66 20 28 |rue);..e|lse if (|
|000044e0| 47 65 74 52 6f 74 52 65 | 63 2e 69 45 72 72 6f 72 |GetRotRe|c.iError|
|000044f0| 20 21 3d 20 4f 70 4e 6f | 74 49 6d 70 6c 29 0d 09 | != OpNo|tImpl)..|
|00004500| 20 20 20 20 20 20 20 53 | 68 6f 77 4c 61 6e 64 73 | S|howLands|
|00004510| 63 61 70 65 52 65 73 75 | 6c 74 73 20 28 66 61 6c |capeResu|lts (fal|
|00004520| 73 65 29 3b 0d 0d 7d 09 | 2f 2f 20 20 65 6e 64 20 |se);..}.|// end |
|00004530| 6f 66 20 49 73 4c 61 6e | 64 73 63 61 70 65 53 65 |of IsLan|dscapeSe|
|00004540| 74 0d 0d 0d 0d 0d 2f 2f | 2d 2d 2d 2d 2d 2d 20 64 |t.....//|------ d|
|00004550| 72 61 77 53 74 75 66 66 | 20 2d 2d 2d 2d 2d 2d 2d |rawStuff| -------|
|00004560| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00004570| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00004580| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00004590| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 0d 2f 2f 0d 2f |--------|---.//./|
|000045a0| 2f 09 64 72 61 77 53 74 | 75 66 66 20 77 69 6c 6c |/.drawSt|uff will|
|000045b0| 20 63 72 65 61 74 65 20 | 74 68 65 20 67 72 61 70 | create |the grap|
|000045c0| 68 20 61 6e 64 20 64 72 | 61 77 20 69 74 20 64 69 |h and dr|aw it di|
|000045d0| 72 65 63 74 6c 79 20 74 | 6f 20 74 68 65 20 63 75 |rectly t|o the cu|
|000045e0| 72 72 65 6e 74 20 70 6f | 72 74 20 74 68 61 74 20 |rrent po|rt that |
|000045f0| 69 73 0d 2f 2f 09 70 61 | 73 73 65 64 20 69 6e 20 |is.//.pa|ssed in |
|00004600| 76 69 61 20 74 68 65 20 | 70 72 50 6f 72 74 20 76 |via the |prPort v|
|00004610| 61 72 69 61 62 6c 65 2e | 20 49 74 20 77 69 6c 6c |ariable.| It will|
|00004620| 20 64 72 61 77 20 61 6c | 6c 20 6f 66 20 74 68 65 | draw al|l of the|
|00004630| 20 63 6f 6f 72 64 69 6e | 61 74 65 73 20 61 6e 64 | coordin|ates and|
|00004640| 20 66 6f 6e 74 0d 2f 2f | 09 73 69 7a 65 73 20 61 | font.//|.sizes a|
|00004650| 74 20 74 68 65 20 70 72 | 53 63 61 6c 65 20 76 61 |t the pr|Scale va|
|00004660| 6c 75 65 2e 20 20 46 6f | 72 20 65 78 61 6d 70 6c |lue. Fo|r exampl|
|00004670| 65 2c 20 6f 6e 20 74 68 | 65 20 49 6d 61 67 65 57 |e, on th|e ImageW|
|00004680| 72 69 74 65 72 2c 20 74 | 68 65 20 73 63 61 6c 69 |riter, t|he scali|
|00004690| 6e 67 20 69 73 20 32 58 | 20 0d 2f 2f 20 20 74 68 |ng is 2X| .// th|
|000046a0| 65 20 73 63 72 65 65 6e | 2e 20 4f 6e 20 74 68 65 |e screen|. On the|
|000046b0| 20 49 6d 61 67 65 57 72 | 69 74 65 72 20 4c 51 2c | ImageWr|iter LQ,|
|000046c0| 20 74 68 72 65 65 20 74 | 69 6d 65 73 20 61 6e 64 | three t|imes and|
|000046d0| 20 6f 6e 20 74 68 65 20 | 4c 61 73 65 72 57 72 69 | on the |LaserWri|
|000046e0| 74 65 72 2c 20 66 6f 75 | 72 20 74 69 6d 65 73 2e |ter, fou|r times.|
|000046f0| 0d 2f 2f 09 54 42 79 20 | 75 73 69 6e 67 20 61 20 |.//.TBy |using a |
|00004700| 73 63 61 6c 65 20 66 61 | 63 74 6f 72 20 65 6e 73 |scale fa|ctor ens|
|00004710| 75 72 65 73 20 74 68 61 | 74 20 79 6f 75 20 64 6f |ures tha|t you do|
|00004720| 20 4e 4f 54 20 70 72 69 | 6e 74 20 22 6d 69 63 72 | NOT pri|nt "micr|
|00004730| 6f 22 20 69 6d 61 67 65 | 73 20 6f 72 20 74 65 78 |o" image|s or tex|
|00004740| 74 20 77 68 65 6e 20 0d | 2f 2f 09 74 68 65 20 53 |t when .|//.the S|
|00004750| 65 74 52 73 6c 20 6f 70 | 63 6f 64 65 20 69 73 20 |etRsl op|code is |
|00004760| 75 73 65 64 2e 0d 2f 2f | 0d 2f 2f 20 20 54 68 65 |used..//|.// The|
|00004770| 20 6e 75 6d 62 65 72 20 | 6f 66 20 6c 69 6e 65 20 | number |of line |
|00004780| 73 65 67 6d 65 6e 74 73 | 20 75 73 65 64 20 74 6f |segments| used to|
|00004790| 20 64 72 61 77 20 6f 75 | 72 20 67 72 61 70 68 20 | draw ou|r graph |
|000047a0| 69 73 20 69 73 20 64 69 | 72 65 63 74 6c 79 20 70 |is is di|rectly p|
|000047b0| 72 6f 70 6f 72 74 69 6f | 6e 61 6c 20 74 6f 20 0d |roportio|nal to .|
|000047c0| 2f 2f 09 74 68 65 20 67 | 53 63 61 6c 65 20 66 61 |//.the g|Scale fa|
|000047d0| 63 74 6f 72 20 28 69 2e | 65 2e 20 70 72 53 63 61 |ctor (i.|e. prSca|
|000047e0| 6c 65 29 2c 20 77 68 69 | 63 68 20 69 73 20 77 68 |le), whi|ch is wh|
|000047f0| 79 20 79 6f 75 20 77 69 | 6c 6c 20 67 65 74 20 73 |y you wi|ll get s|
|00004800| 6d 6f 6f 74 68 65 72 20 | 63 75 72 76 65 73 20 77 |moother |curves w|
|00004810| 68 65 6e 20 0d 2f 2f 09 | 75 73 69 6e 67 20 74 68 |hen .//.|using th|
|00004820| 65 20 53 65 74 52 73 6c | 20 6f 70 63 6f 64 65 20 |e SetRsl| opcode |
|00004830| 6f 6e 20 61 6e 79 20 70 | 72 69 6e 74 65 72 20 64 |on any p|rinter d|
|00004840| 72 69 76 65 72 20 74 68 | 61 74 20 73 75 70 70 6f |river th|at suppo|
|00004850| 72 74 73 20 69 74 2e 20 | 46 6f 72 20 65 78 61 6d |rts it. |For exam|
|00004860| 70 6c 65 2c 20 6f 6e 20 | 0d 2f 2f 09 74 68 65 20 |ple, on |.//.the |
|00004870| 4c 61 73 65 72 57 72 69 | 74 65 72 20 49 49 2f 4e |LaserWri|ter II/N|
|00004880| 54 20 74 68 65 20 67 53 | 63 61 6c 65 20 66 61 63 |T the gS|cale fac|
|00004890| 74 6f 72 20 69 73 20 34 | 3b 20 77 68 69 63 68 20 |tor is 4|; which |
|000048a0| 6d 65 61 6e 73 20 66 6f | 72 20 61 20 67 69 76 65 |means fo|r a give|
|000048b0| 6e 20 6c 69 6e 65 20 73 | 65 67 6d 65 6e 74 20 0d |n line s|egment .|
|000048c0| 2f 2f 09 69 6e 20 74 68 | 65 20 63 75 72 76 65 2c |//.in th|e curve,|
|000048d0| 20 79 6f 75 20 77 69 6c | 6c 20 68 61 76 65 20 33 | you wil|l have 3|
|000048e0| 20 61 64 64 69 74 69 6f | 6e 61 6c 20 70 6f 69 6e | additio|nal poin|
|000048f0| 74 73 20 77 68 65 6e 20 | 70 72 69 6e 74 69 6e 67 |ts when |printing|
|00004900| 20 77 69 74 68 20 53 65 | 74 52 73 6c 2e 0d 2f 2f | with Se|tRsl..//|
|00004910| 0d 0d 76 6f 69 64 20 64 | 72 61 77 53 74 75 66 66 |..void d|rawStuff|
|00004920| 20 28 20 70 72 50 6f 72 | 74 2c 20 70 72 53 63 61 | ( prPor|t, prSca|
|00004930| 6c 65 29 0d 0d 47 72 61 | 66 50 74 72 09 09 70 72 |le)..Gra|fPtr..pr|
|00004940| 50 6f 72 74 3b 0d 73 68 | 6f 72 74 09 09 70 72 53 |Port;.sh|ort..prS|
|00004950| 63 61 6c 65 3b 0d 7b 0d | 09 73 68 6f 72 74 09 09 |cale;.{.|.short..|
|00004960| 74 68 65 46 6f 6e 74 49 | 44 3b 0d 09 52 65 63 74 |theFontI|D;..Rect|
|00004970| 09 09 67 72 61 70 68 52 | 65 63 74 3b 0d 0d 09 73 |..graphR|ect;...s|
|00004980| 68 6f 72 74 09 09 6c 6f | 6f 70 2c 0d 09 09 09 09 |hort..lo|op,.....|
|00004990| 70 6c 6f 74 58 2c 20 0d | 09 09 09 09 70 6c 6f 74 |plotX, .|....plot|
|000049a0| 59 3b 0d 09 0d 09 65 78 | 74 65 6e 64 65 64 20 09 |Y;....ex|tended .|
|000049b0| 78 20 20 3d 20 2d 32 2e | 35 2c 20 0d 09 09 09 09 |x = -2.|5, .....|
|000049c0| 79 3b 0d 09 53 74 72 32 | 35 35 09 09 73 63 61 6c |y;..Str2|55..scal|
|000049d0| 65 56 61 6c 75 65 53 74 | 72 3b 0d 0d 09 43 47 72 |eValueSt|r;...CGr|
|000049e0| 61 66 50 74 72 20 20 20 | 20 63 75 72 72 50 6f 72 |afPtr | currPor|
|000049f0| 74 3b 0d 09 47 44 48 61 | 6e 64 6c 65 09 63 75 72 |t;..GDHa|ndle.cur|
|00004a00| 72 44 65 76 3b 0d 09 0d | 0d 09 47 65 74 47 57 6f |rDev;...|..GetGWo|
|00004a10| 72 6c 64 20 28 26 63 75 | 72 72 50 6f 72 74 2c 20 |rld (&cu|rrPort, |
|00004a20| 26 63 75 72 72 44 65 76 | 29 3b 0d 0d 09 53 65 74 |&currDev|);...Set|
|00004a30| 47 57 6f 72 6c 64 20 28 | 28 43 47 72 61 66 50 74 |GWorld (|(CGrafPt|
|00004a40| 72 29 20 70 72 50 6f 72 | 74 2c 20 63 75 72 72 44 |r) prPor|t, currD|
|00004a50| 65 76 29 3b 0d 0d 09 53 | 65 74 52 65 63 74 20 28 |ev);...S|etRect (|
|00004a60| 26 67 72 61 70 68 52 65 | 63 74 2c 20 30 2c 20 30 |&graphRe|ct, 0, 0|
|00004a70| 2c 20 35 30 30 2c 20 33 | 30 30 29 3b 0d 09 0d 09 |, 500, 3|00);....|
|00004a80| 45 72 61 73 65 52 65 63 | 74 20 28 26 28 70 72 50 |EraseRec|t (&(prP|
|00004a90| 6f 72 74 2d 3e 70 6f 72 | 74 52 65 63 74 29 29 3b |ort->por|tRect));|
|00004aa0| 0d 09 0d 09 0d 09 2f 2f | 20 50 72 69 6e 74 20 74 |......//| Print t|
|00004ab0| 68 65 20 68 65 61 64 69 | 6e 67 20 6f 66 20 74 68 |he headi|ng of th|
|00004ac0| 65 20 67 72 61 70 68 2e | 2e 2e 0d 09 0d 20 20 20 |e graph.|..... |
|00004ad0| 20 47 65 74 46 4e 75 6d | 28 22 5c 70 48 65 6c 76 | GetFNum|("\pHelv|
|00004ae0| 65 74 69 63 61 22 2c 20 | 26 74 68 65 46 6f 6e 74 |etica", |&theFont|
|00004af0| 49 44 29 3b 0d 20 20 20 | 20 54 65 78 74 46 6f 6e |ID);. | TextFon|
|00004b00| 74 28 74 68 65 46 6f 6e | 74 49 44 29 3b 0d 09 54 |t(theFon|tID);..T|
|00004b10| 65 78 74 53 69 7a 65 20 | 28 46 6f 6e 74 53 69 7a |extSize |(FontSiz|
|00004b20| 65 20 2a 20 70 72 53 63 | 61 6c 65 29 3b 0d 09 4d |e * prSc|ale);..M|
|00004b30| 6f 76 65 54 6f 20 28 20 | 31 32 30 20 2a 20 70 72 |oveTo ( |120 * pr|
|00004b40| 53 63 61 6c 65 2c 20 35 | 35 20 2a 20 70 72 53 63 |Scale, 5|5 * prSc|
|00004b50| 61 6c 65 29 3b 0d 09 44 | 72 61 77 53 74 72 69 6e |ale);..D|rawStrin|
|00004b60| 67 20 28 22 5c 70 50 72 | 69 6e 74 69 6e 67 20 61 |g ("\pPr|inting a|
|00004b70| 74 20 22 29 3b 0d 09 0d | 09 69 66 20 28 67 4d 61 |t ");...|.if (gMa|
|00004b80| 78 44 50 49 20 3d 3d 20 | 30 29 0d 09 20 20 4e 75 |xDPI == |0).. Nu|
|00004b90| 6d 54 6f 53 74 72 69 6e | 67 20 28 28 2a 2a 67 50 |mToStrin|g ((**gP|
|00004ba0| 72 52 65 63 48 64 6c 29 | 2e 70 72 49 6e 66 6f 2e |rRecHdl)|.prInfo.|
|00004bb0| 69 48 52 65 73 2c 20 26 | 73 63 61 6c 65 56 61 6c |iHRes, &|scaleVal|
|00004bc0| 75 65 53 74 72 29 3b 0d | 09 65 6c 73 65 20 20 4e |ueStr);.|.else N|
|00004bd0| 75 6d 54 6f 53 74 72 69 | 6e 67 20 28 67 4d 61 78 |umToStri|ng (gMax|
|00004be0| 44 50 49 2c 20 26 73 63 | 61 6c 65 56 61 6c 75 65 |DPI, &sc|aleValue|
|00004bf0| 53 74 72 29 3b 0d 09 0d | 09 44 72 61 77 53 74 72 |Str);...|.DrawStr|
|00004c00| 69 6e 67 20 28 73 63 61 | 6c 65 56 61 6c 75 65 53 |ing (sca|leValueS|
|00004c10| 74 72 29 3b 0d 0d 09 4d | 6f 76 65 54 6f 20 28 32 |tr);...M|oveTo (2|
|00004c20| 30 31 20 2a 20 70 72 53 | 63 61 6c 65 20 2c 20 35 |01 * prS|cale , 5|
|00004c30| 35 20 2a 20 70 72 53 63 | 61 6c 65 29 3b 0d 09 44 |5 * prSc|ale);..D|
|00004c40| 72 61 77 53 74 72 69 6e | 67 20 28 22 5c 70 64 70 |rawStrin|g ("\pdp|
|00004c50| 69 22 29 3b 0d 09 0d 09 | 0d 09 2f 2f 20 20 44 72 |i");....|..// Dr|
|00004c60| 61 77 20 74 68 65 20 61 | 78 65 73 20 6f 66 20 74 |aw the a|xes of t|
|00004c70| 68 65 20 67 72 61 70 68 | 2e 2e 2e 0d 09 0d 09 50 |he graph|.......P|
|00004c80| 65 6e 53 69 7a 65 28 32 | 20 2a 20 70 72 53 63 61 |enSize(2| * prSca|
|00004c90| 6c 65 2c 20 31 20 2a 20 | 70 72 53 63 61 6c 65 29 |le, 1 * |prScale)|
|00004ca0| 3b 0d 0d 09 4d 6f 76 65 | 54 6f 20 28 28 67 72 61 |;...Move|To ((gra|
|00004cb0| 70 68 52 65 63 74 2e 6c | 65 66 74 20 2b 20 32 30 |phRect.l|eft + 20|
|00004cc0| 29 20 2a 20 70 72 53 63 | 61 6c 65 2c 20 28 67 72 |) * prSc|ale, (gr|
|00004cd0| 61 70 68 52 65 63 74 2e | 74 6f 70 20 2b 20 34 35 |aphRect.|top + 45|
|00004ce0| 29 20 2a 20 70 72 53 63 | 61 6c 65 29 3b 0d 09 4c |) * prSc|ale);..L|
|00004cf0| 69 6e 65 54 6f 20 28 28 | 67 72 61 70 68 52 65 63 |ineTo ((|graphRec|
|00004d00| 74 2e 6c 65 66 74 20 2b | 20 32 30 29 20 2a 20 70 |t.left +| 20) * p|
|00004d10| 72 53 63 61 6c 65 2c 20 | 28 67 72 61 70 68 52 65 |rScale, |(graphRe|
|00004d20| 63 74 2e 62 6f 74 74 6f | 6d 20 2d 20 34 35 29 20 |ct.botto|m - 45) |
|00004d30| 2a 20 70 72 53 63 61 6c | 65 29 3b 0d 09 4d 6f 76 |* prScal|e);..Mov|
|00004d40| 65 54 6f 20 28 28 67 72 | 61 70 68 52 65 63 74 2e |eTo ((gr|aphRect.|
|00004d50| 6c 65 66 74 20 2b 20 32 | 30 29 20 2a 20 70 72 53 |left + 2|0) * prS|
|00004d60| 63 61 6c 65 2c 20 28 28 | 67 72 61 70 68 52 65 63 |cale, ((|graphRec|
|00004d70| 74 2e 62 6f 74 74 6f 6d | 20 2d 20 67 72 61 70 68 |t.bottom| - graph|
|00004d80| 52 65 63 74 2e 74 6f 70 | 29 2f 32 29 20 2a 20 70 |Rect.top|)/2) * p|
|00004d90| 72 53 63 61 6c 65 29 3b | 0d 09 4c 69 6e 65 54 6f |rScale);|..LineTo|
|00004da0| 20 28 28 67 72 61 70 68 | 52 65 63 74 2e 72 69 67 | ((graph|Rect.rig|
|00004db0| 68 74 20 2d 20 31 37 30 | 29 20 2a 20 70 72 53 63 |ht - 170|) * prSc|
|00004dc0| 61 6c 65 2c 20 28 28 67 | 72 61 70 68 52 65 63 74 |ale, ((g|raphRect|
|00004dd0| 2e 62 6f 74 74 6f 6d 20 | 2d 20 67 72 61 70 68 52 |.bottom |- graphR|
|00004de0| 65 63 74 2e 74 6f 70 29 | 2f 32 29 20 2a 20 70 72 |ect.top)|/2) * pr|
|00004df0| 53 63 61 6c 65 29 3b 0d | 09 0d 09 0d 09 2f 2f 20 |Scale);.|.....// |
|00004e00| 20 44 72 61 77 20 74 68 | 65 20 6c 6f 77 65 72 20 | Draw th|e lower |
|00004e10| 63 75 72 76 65 2e 2e 2e | 0d 09 0d 20 20 20 20 4d |curve...|... M|
|00004e20| 6f 76 65 54 6f 20 28 28 | 67 72 61 70 68 52 65 63 |oveTo ((|graphRec|
|00004e30| 74 2e 6c 65 66 74 20 2b | 20 32 30 29 20 2a 20 70 |t.left +| 20) * p|
|00004e40| 72 53 63 61 6c 65 2c 20 | 28 28 67 72 61 70 68 52 |rScale, |((graphR|
|00004e50| 65 63 74 2e 62 6f 74 74 | 6f 6d 20 2d 20 67 72 61 |ect.bott|om - gra|
|00004e60| 70 68 52 65 63 74 2e 74 | 6f 70 29 2f 32 29 20 2a |phRect.t|op)/2) *|
|00004e70| 20 70 72 53 63 61 6c 65 | 29 3b 0d 09 50 65 6e 53 | prScale|);..PenS|
|00004e80| 69 7a 65 28 31 2c 31 29 | 3b 0d 09 0d 20 20 20 20 |ize(1,1)|;... |
|00004e90| 70 6c 6f 74 58 20 3d 20 | 28 67 72 61 70 68 52 65 |plotX = |(graphRe|
|00004ea0| 63 74 2e 6c 65 66 74 20 | 2b 20 32 30 29 20 2a 20 |ct.left |+ 20) * |
|00004eb0| 70 72 53 63 61 6c 65 3b | 0d 20 20 20 20 70 6c 6f |prScale;|. plo|
|00004ec0| 74 59 20 3d 20 28 28 67 | 72 61 70 68 52 65 63 74 |tY = ((g|raphRect|
|00004ed0| 2e 62 6f 74 74 6f 6d 20 | 2d 20 67 72 61 70 68 52 |.bottom |- graphR|
|00004ee0| 65 63 74 2e 74 6f 70 20 | 2d 20 38 35 29 2f 32 29 |ect.top |- 85)/2)|
|00004ef0| 20 2a 20 70 72 53 63 61 | 6c 65 3b 0d 0d 09 0d 09 | * prSca|le;.....|
|00004f00| 2f 2f 20 54 68 65 20 6e | 75 6d 62 65 72 20 6f 66 |// The n|umber of|
|00004f10| 20 6c 69 6e 65 20 73 65 | 67 6d 65 6e 74 73 20 69 | line se|gments i|
|00004f20| 73 20 64 69 72 65 63 74 | 6c 79 20 70 72 6f 70 6f |s direct|ly propo|
|00004f30| 72 74 69 6f 6e 61 6c 20 | 74 6f 20 74 68 65 20 67 |rtional |to the g|
|00004f40| 53 63 61 6c 65 20 66 61 | 63 74 6f 72 20 28 69 2e |Scale fa|ctor (i.|
|00004f50| 65 2e 20 70 72 53 63 61 | 6c 65 29 2c 20 0d 09 2f |e. prSca|le), ../|
|00004f60| 2f 20 77 68 69 63 68 20 | 69 73 20 77 68 79 20 79 |/ which |is why y|
|00004f70| 6f 75 20 77 69 6c 6c 20 | 67 65 74 20 73 6d 6f 6f |ou will |get smoo|
|00004f80| 74 68 65 72 20 63 75 72 | 76 65 73 20 77 68 65 6e |ther cur|ves when|
|00004f90| 20 75 73 69 6e 67 20 74 | 68 65 20 53 65 74 52 73 | using t|he SetRs|
|00004fa0| 6c 20 6f 70 63 6f 64 65 | 20 6f 6e 20 61 6e 79 20 |l opcode| on any |
|00004fb0| 70 72 69 6e 74 65 72 20 | 0d 09 2f 2f 20 64 72 69 |printer |..// dri|
|00004fc0| 76 65 72 20 74 68 61 74 | 20 73 75 70 70 6f 72 74 |ver that| support|
|00004fd0| 73 20 69 74 2e 20 46 6f | 72 20 65 78 61 6d 70 6c |s it. Fo|r exampl|
|00004fe0| 65 2c 20 6f 6e 20 74 68 | 65 20 4c 61 73 65 72 57 |e, on th|e LaserW|
|00004ff0| 72 69 74 65 72 20 49 49 | 2f 4e 54 20 74 68 65 20 |riter II|/NT the |
|00005000| 67 53 63 61 6c 65 20 66 | 61 63 74 6f 72 20 69 73 |gScale f|actor is|
|00005010| 20 34 3b 0d 09 2f 2f 20 | 77 68 69 63 68 20 6d 65 | 4;..// |which me|
|00005020| 61 6e 73 20 66 6f 72 20 | 61 20 67 69 76 65 6e 20 |ans for |a given |
|00005030| 6c 69 6e 65 20 73 65 67 | 6d 65 6e 74 20 69 6e 20 |line seg|ment in |
|00005040| 74 68 65 20 63 75 72 76 | 65 2c 20 79 6f 75 20 77 |the curv|e, you w|
|00005050| 69 6c 6c 20 68 61 76 65 | 20 33 20 61 64 64 69 74 |ill have| 3 addit|
|00005060| 69 6f 6e 61 6c 20 70 6f | 69 6e 74 73 0d 09 2f 2f |ional po|ints..//|
|00005070| 20 77 68 65 6e 20 70 72 | 69 6e 74 69 6e 67 20 77 | when pr|inting w|
|00005080| 69 74 68 20 53 65 74 52 | 73 6c 2e 0d 20 20 20 20 |ith SetR|sl.. |
|00005090| 0d 09 66 6f 72 20 28 6c | 6f 6f 70 20 3d 20 31 3b |..for (l|oop = 1;|
|000050a0| 20 6c 6f 6f 70 20 3c 20 | 32 30 20 2a 20 70 72 53 | loop < |20 * prS|
|000050b0| 63 61 6c 65 3b 20 6c 6f | 6f 70 2b 2b 29 0d 20 20 |cale; lo|op++). |
|000050c0| 20 20 20 20 7b 0d 20 09 | 09 79 20 3d 20 28 73 69 | {. .|.y = (si|
|000050d0| 6e 20 28 78 2f 32 29 29 | 20 2a 20 33 35 20 2b 20 |n (x/2))| * 35 + |
|000050e0| 32 3b 0d 20 20 0d 20 20 | 20 20 20 20 20 20 70 6c |2;. . | pl|
|000050f0| 6f 74 59 20 3d 20 28 70 | 6c 6f 74 59 20 2b 20 28 |otY = (p|lotY + (|
|00005100| 28 69 6e 74 29 20 79 29 | 29 3b 0d 20 20 20 20 20 |(int) y)|);. |
|00005110| 20 20 20 70 6c 6f 74 58 | 20 3d 20 28 70 6c 6f 74 | plotX| = (plot|
|00005120| 58 20 2b 20 28 28 69 6e | 74 29 20 78 29 29 3b 0d |X + ((in|t) x));.|
|00005130| 20 20 20 20 20 20 0d 20 | 20 20 20 20 20 09 69 66 | . | .if|
|00005140| 20 28 70 6c 6f 74 58 20 | 3e 3d 20 28 67 72 61 70 | (plotX |>= (grap|
|00005150| 68 52 65 63 74 2e 6c 65 | 66 74 20 2b 20 32 32 29 |hRect.le|ft + 22)|
|00005160| 20 2a 20 70 72 53 63 61 | 6c 65 29 0d 09 20 20 20 | * prSca|le).. |
|00005170| 20 20 20 4c 69 6e 65 54 | 6f 20 28 70 6c 6f 74 58 | LineT|o (plotX|
|00005180| 2c 20 70 6c 6f 74 59 29 | 3b 0d 0d 20 20 20 20 20 |, plotY)|;.. |
|00005190| 20 20 20 70 6c 6f 74 58 | 20 2b 3d 20 31 30 3b 0d | plotX| += 10;.|
|000051a0| 09 0d 20 20 20 20 20 20 | 20 20 78 20 2b 3d 20 31 |.. | x += 1|
|000051b0| 2e 30 20 2f 20 28 66 6c | 6f 61 74 29 20 70 72 53 |.0 / (fl|oat) prS|
|000051c0| 63 61 6c 65 3b 0d 20 20 | 20 20 20 20 7d 0d 0d 0d |cale;. | }...|
|000051d0| 09 2f 2f 20 20 44 72 61 | 77 20 74 68 65 20 6c 6f |.// Dra|w the lo|
|000051e0| 77 65 72 20 63 75 72 76 | 65 0d 09 78 20 20 3d 20 |wer curv|e..x = |
|000051f0| 30 3b 0d 09 20 20 0d 20 | 09 4d 6f 76 65 54 6f 20 |0;.. . |.MoveTo |
|00005200| 28 28 67 72 61 70 68 52 | 65 63 74 2e 6c 65 66 74 |((graphR|ect.left|
|00005210| 20 2b 20 32 30 29 20 2a | 20 70 72 53 63 61 6c 65 | + 20) *| prScale|
|00005220| 2c 20 28 28 67 72 61 70 | 68 52 65 63 74 2e 62 6f |, ((grap|hRect.bo|
|00005230| 74 74 6f 6d 20 2d 20 67 | 72 61 70 68 52 65 63 74 |ttom - g|raphRect|
|00005240| 2e 74 6f 70 29 2f 32 29 | 20 2a 20 70 72 53 63 61 |.top)/2)| * prSca|
|00005250| 6c 65 29 3b 0d 0d 20 20 | 20 20 70 6c 6f 74 58 20 |le);.. | plotX |
|00005260| 3d 20 28 67 72 61 70 68 | 52 65 63 74 2e 6c 65 66 |= (graph|Rect.lef|
|00005270| 74 20 2b 20 32 30 29 20 | 2a 20 70 72 53 63 61 6c |t + 20) |* prScal|
|00005280| 65 3b 0d 20 20 20 20 70 | 6c 6f 74 59 20 3d 20 28 |e;. p|lotY = (|
|00005290| 28 67 72 61 70 68 52 65 | 63 74 2e 62 6f 74 74 6f |(graphRe|ct.botto|
|000052a0| 6d 20 2d 20 67 72 61 70 | 68 52 65 63 74 2e 74 6f |m - grap|hRect.to|
|000052b0| 70 20 2d 20 36 30 29 2f | 32 29 20 2a 20 70 72 53 |p - 60)/|2) * prS|
|000052c0| 63 61 6c 65 3b 0d 0d 20 | 20 20 20 66 6f 72 20 28 |cale;.. | for (|
|000052d0| 6c 6f 6f 70 20 3d 20 31 | 3b 20 6c 6f 6f 70 20 3c |loop = 1|; loop <|
|000052e0| 20 31 38 20 2a 20 70 72 | 53 63 61 6c 65 3b 20 6c | 18 * pr|Scale; l|
|000052f0| 6f 6f 70 2b 2b 29 0d 20 | 20 20 20 20 20 7b 0d 20 |oop++). | {. |
|00005300| 09 09 79 20 3d 20 28 63 | 6f 73 20 28 78 2f 32 29 |..y = (c|os (x/2)|
|00005310| 29 20 2a 20 34 30 20 2b | 20 32 3b 0d 20 20 0d 20 |) * 40 +| 2;. . |
|00005320| 20 20 20 20 20 20 20 70 | 6c 6f 74 59 20 3d 20 28 | p|lotY = (|
|00005330| 70 6c 6f 74 59 20 2b 20 | 28 28 69 6e 74 29 20 79 |plotY + |((int) y|
|00005340| 29 29 3b 0d 20 20 20 20 | 20 20 20 20 70 6c 6f 74 |));. | plot|
|00005350| 58 20 3d 20 28 70 6c 6f | 74 58 20 2b 20 28 28 69 |X = (plo|tX + ((i|
|00005360| 6e 74 29 20 78 29 29 3b | 0d 20 20 20 20 20 20 0d |nt) x));|. .|
|00005370| 20 20 20 20 20 20 09 69 | 66 20 28 70 6c 6f 74 58 | .i|f (plotX|
|00005380| 20 3e 3d 20 28 67 72 61 | 70 68 52 65 63 74 2e 6c | >= (gra|phRect.l|
|00005390| 65 66 74 20 2b 20 32 32 | 29 20 2a 20 70 72 53 63 |eft + 22|) * prSc|
|000053a0| 61 6c 65 29 0d 09 20 20 | 20 20 20 20 4c 69 6e 65 |ale).. | Line|
|000053b0| 54 6f 20 28 70 6c 6f 74 | 58 2c 20 70 6c 6f 74 59 |To (plot|X, plotY|
|000053c0| 29 3b 0d 0d 20 20 20 20 | 20 20 20 20 70 6c 6f 74 |);.. | plot|
|000053d0| 58 20 2b 3d 20 31 30 3b | 0d 09 0d 20 20 20 20 20 |X += 10;|... |
|000053e0| 20 20 20 78 20 2b 3d 20 | 31 2e 30 20 2f 20 28 66 | x += |1.0 / (f|
|000053f0| 6c 6f 61 74 29 20 70 72 | 53 63 61 6c 65 3b 0d 20 |loat) pr|Scale;. |
|00005400| 20 20 20 20 20 7d 0d 0d | 20 20 20 53 65 74 47 57 | }..| SetGW|
|00005410| 6f 72 6c 64 20 28 63 75 | 72 72 50 6f 72 74 2c 20 |orld (cu|rrPort, |
|00005420| 63 75 72 72 44 65 76 29 | 3b 0d 20 0d 7d 20 20 20 |currDev)|;. .} |
|00005430| 20 2f 2f 20 65 6e 64 20 | 6f 66 20 64 72 61 77 53 | // end |of drawS|
|00005440| 74 75 66 66 0d 0d 0d 0d | 0d 2f 2f 2d 2d 2d 2d 2d |tuff....|.//-----|
|00005450| 2d 20 63 6f 70 79 42 69 | 74 73 4d 79 47 72 61 70 |- copyBi|tsMyGrap|
|00005460| 68 20 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |h ------|--------|
|00005470| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00005480| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00005490| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 0d |--------|-------.|
|000054a0| 2f 2f 0d 2f 2f 09 63 6f | 70 79 42 69 74 73 4d 79 |//.//.co|pyBitsMy|
|000054b0| 47 72 61 70 68 20 77 69 | 6c 6c 20 63 72 65 61 74 |Graph wi|ll creat|
|000054c0| 65 20 61 20 6f 66 66 2d | 73 63 72 65 65 6e 20 77 |e a off-|screen w|
|000054d0| 6f 72 6c 64 20 77 69 74 | 68 20 61 20 63 61 6c 6c |orld wit|h a call|
|000054e0| 20 74 6f 20 33 32 2d 62 | 69 74 20 51 75 69 63 6b | to 32-b|it Quick|
|000054f0| 44 72 61 77 27 73 0d 2f | 2f 20 20 4e 65 77 47 57 |Draw's./|/ NewGW|
|00005500| 6f 72 6c 64 2e 20 20 57 | 65 20 63 68 65 63 6b 20 |orld. W|e check |
|00005510| 74 6f 20 6d 61 6b 65 20 | 73 75 72 65 20 74 68 61 |to make |sure tha|
|00005520| 74 20 33 32 2d 62 69 74 | 20 51 75 69 63 6b 44 72 |t 32-bit| QuickDr|
|00005530| 61 77 20 69 73 20 70 72 | 65 73 65 6e 74 20 42 45 |aw is pr|esent BE|
|00005540| 46 4f 52 45 20 74 68 69 | 73 20 0d 2f 2f 20 20 66 |FORE thi|s .// f|
|00005550| 75 6e 63 74 69 6f 6e 20 | 69 73 20 63 61 6c 6c 65 |unction |is calle|
|00005560| 64 2e 20 20 57 65 20 77 | 69 6c 6c 20 74 68 65 6e |d. We w|ill then|
|00005570| 20 64 72 61 77 20 64 69 | 72 65 63 74 6c 79 20 69 | draw di|rectly i|
|00005580| 6e 74 6f 20 74 68 65 20 | 74 68 65 20 6f 66 66 2d |nto the |the off-|
|00005590| 73 63 72 65 65 6e 20 77 | 6f 72 6c 64 20 77 69 74 |screen w|orld wit|
|000055a0| 68 20 61 20 63 61 6c 6c | 0d 2f 2f 09 74 6f 20 64 |h a call|.//.to d|
|000055b0| 72 61 77 53 74 75 66 66 | 2e 20 20 43 6f 70 79 42 |rawStuff|. CopyB|
|000055c0| 69 74 73 20 77 69 6c 6c | 20 74 68 65 6e 20 62 65 |its will| then be|
|000055d0| 20 75 73 65 64 20 74 6f | 20 63 6f 70 79 20 74 68 | used to| copy th|
|000055e0| 65 20 63 6f 6e 74 65 6e | 74 73 20 6f 66 20 74 68 |e conten|ts of th|
|000055f0| 65 20 6f 66 66 2d 73 63 | 72 65 65 6e 20 77 6f 72 |e off-sc|reen wor|
|00005600| 6c 64 0d 2f 2f 09 69 6e | 74 6f 20 74 68 65 20 70 |ld.//.in|to the p|
|00005610| 72 69 6e 74 65 72 27 73 | 20 47 72 61 66 50 6f 72 |rinter's| GrafPor|
|00005620| 74 2e 20 20 52 65 6d 65 | 6d 62 65 72 2c 20 77 68 |t. Reme|mber, wh|
|00005630| 65 6e 20 79 6f 75 20 75 | 73 65 20 74 68 65 20 44 |en you u|se the D|
|00005640| 72 61 66 74 42 69 74 73 | 20 6f 70 63 6f 64 65 2c |raftBits| opcode,|
|00005650| 20 69 74 20 77 69 6c 6c | 20 0d 2f 2f 20 20 6f 6e | it will| .// on|
|00005660| 6c 79 20 70 72 69 6e 74 | 20 74 65 78 74 2c 20 62 |ly print| text, b|
|00005670| 69 74 6d 61 70 73 2c 20 | 61 6e 64 20 70 69 78 6d |itmaps, |and pixm|
|00005680| 61 70 73 2e 20 20 49 66 | 20 77 65 20 64 69 64 20 |aps. If| we did |
|00005690| 4e 4f 54 20 75 73 65 20 | 74 68 65 20 43 6f 70 79 |NOT use |the Copy|
|000056a0| 42 69 74 73 20 63 61 6c | 6c 2c 20 6f 6e 6c 79 20 |Bits cal|l, only |
|000056b0| 74 68 65 20 0d 2f 2f 09 | 68 65 61 64 69 6e 67 20 |the .//.|heading |
|000056c0| 6f 66 20 74 68 65 20 67 | 72 61 70 68 20 77 6f 75 |of the g|raph wou|
|000056d0| 6c 64 20 62 65 20 70 72 | 69 6e 74 65 64 2e 2e 2e |ld be pr|inted...|
|000056e0| 0d 2f 2f 0d 0d 76 6f 69 | 64 20 63 6f 70 79 42 69 |.//..voi|d copyBi|
|000056f0| 74 73 4d 79 47 72 61 70 | 68 20 28 54 50 50 72 50 |tsMyGrap|h (TPPrP|
|00005700| 6f 72 74 20 70 72 69 6e | 74 50 6f 72 74 29 0d 7b |ort prin|tPort).{|
|00005710| 0d 09 52 65 63 74 09 09 | 67 72 61 70 68 52 65 63 |..Rect..|graphRec|
|00005720| 74 3b 0d 20 20 20 20 51 | 44 45 72 72 09 09 51 44 |t;. Q|DErr..QD|
|00005730| 45 72 72 6f 72 3b 0d 09 | 47 44 48 61 6e 64 6c 65 |Error;..|GDHandle|
|00005740| 09 63 75 72 72 44 65 76 | 3b 0d 09 43 47 72 61 66 |.currDev|;..CGraf|
|00005750| 50 74 72 09 63 75 72 72 | 50 6f 72 74 3b 0d 09 47 |Ptr.curr|Port;..G|
|00005760| 57 6f 72 6c 64 50 74 72 | 09 6d 79 44 72 61 77 69 |WorldPtr|.myDrawi|
|00005770| 6e 67 50 6f 72 74 3b 0d | 0d 0d 09 47 65 74 47 57 |ngPort;.|...GetGW|
|00005780| 6f 72 6c 64 20 28 26 63 | 75 72 72 50 6f 72 74 2c |orld (&c|urrPort,|
|00005790| 20 26 63 75 72 72 44 65 | 76 29 3b 0d 09 09 0d 09 | &currDe|v);.....|
|000057a0| 53 65 74 52 65 63 74 20 | 28 26 67 72 61 70 68 52 |SetRect |(&graphR|
|000057b0| 65 63 74 2c 20 30 2c 20 | 30 2c 20 35 30 30 20 2a |ect, 0, |0, 500 *|
|000057c0| 20 67 53 63 61 6c 65 2c | 20 33 30 30 20 2a 20 67 | gScale,| 300 * g|
|000057d0| 53 63 61 6c 65 29 3b 0d | 09 0d 09 51 44 45 72 72 |Scale);.|...QDErr|
|000057e0| 6f 72 20 3d 20 4e 65 77 | 47 57 6f 72 6c 64 28 26 |or = New|GWorld(&|
|000057f0| 6d 79 44 72 61 77 69 6e | 67 50 6f 72 74 2c 20 31 |myDrawin|gPort, 1|
|00005800| 2c 20 26 67 72 61 70 68 | 52 65 63 74 2c 20 6e 69 |, &graph|Rect, ni|
|00005810| 6c 2c 20 6e 69 6c 2c 20 | 30 29 3b 0d 09 0d 09 69 |l, nil, |0);....i|
|00005820| 66 20 28 51 44 45 72 72 | 6f 72 20 3d 3d 20 6e 6f |f (QDErr|or == no|
|00005830| 45 72 72 29 0d 09 20 20 | 7b 0d 09 20 20 20 20 69 |Err).. |{.. i|
|00005840| 66 20 28 21 4c 6f 63 6b | 50 69 78 65 6c 73 20 28 |f (!Lock|Pixels (|
|00005850| 6d 79 44 72 61 77 69 6e | 67 50 6f 72 74 2d 3e 70 |myDrawin|gPort->p|
|00005860| 6f 72 74 50 69 78 4d 61 | 70 29 29 0d 09 09 20 20 |ortPixMa|p))... |
|00005870| 41 6c 65 72 74 55 73 65 | 72 20 28 29 3b 0d 09 09 |AlertUse|r ();...|
|00005880| 0d 09 09 2f 2f 20 20 44 | 72 61 77 20 74 68 65 20 |...// D|raw the |
|00005890| 67 72 61 70 68 20 69 6e | 74 6f 20 74 68 65 20 6f |graph in|to the o|
|000058a0| 66 66 2d 73 63 72 65 65 | 6e 20 77 6f 72 6c 64 2e |ff-scree|n world.|
|000058b0| 2e 2e 0d 09 20 20 09 64 | 72 61 77 53 74 75 66 66 |.... .d|rawStuff|
|000058c0| 20 28 6d 79 44 72 61 77 | 69 6e 67 50 6f 72 74 2c | (myDraw|ingPort,|
|000058d0| 20 67 53 63 61 6c 65 29 | 3b 0d 09 09 0d 09 09 0d | gScale)|;.......|
|000058e0| 09 09 2f 2f 20 20 53 65 | 74 20 74 68 65 20 70 6f |..// Se|t the po|
|000058f0| 72 74 20 74 6f 20 74 68 | 65 20 70 72 69 6e 74 65 |rt to th|e printe|
|00005900| 72 27 73 20 47 72 61 66 | 50 6f 72 74 20 61 6e 64 |r's Graf|Port and|
|00005910| 20 43 6f 70 79 42 69 74 | 73 20 74 68 65 20 6f 66 | CopyBit|s the of|
|00005920| 66 2d 73 63 72 65 65 6e | 0d 09 09 2f 2f 20 20 77 |f-screen|...// w|
|00005930| 6f 72 6c 64 20 69 6e 74 | 6f 20 74 68 65 20 70 72 |orld int|o the pr|
|00005940| 69 6e 74 65 72 27 73 20 | 47 72 61 66 50 6f 72 74 |inter's |GrafPort|
|00005950| 2e 0d 09 09 0d 09 09 53 | 65 74 50 6f 72 74 20 28 |.......S|etPort (|
|00005960| 26 28 70 72 69 6e 74 50 | 6f 72 74 2d 3e 67 50 6f |&(printP|ort->gPo|
|00005970| 72 74 29 29 3b 0d 09 20 | 20 09 43 6f 70 79 42 69 |rt));.. | .CopyBi|
|00005980| 74 73 20 28 28 42 69 74 | 4d 61 70 20 2a 29 20 26 |ts ((Bit|Map *) &|
|00005990| 6d 79 44 72 61 77 69 6e | 67 50 6f 72 74 2d 3e 70 |myDrawin|gPort->p|
|000059a0| 6f 72 74 50 69 78 4d 61 | 70 2c 20 26 28 70 72 69 |ortPixMa|p, &(pri|
|000059b0| 6e 74 50 6f 72 74 2d 3e | 67 50 6f 72 74 2e 70 6f |ntPort->|gPort.po|
|000059c0| 72 74 42 69 74 73 29 2c | 20 0d 09 20 20 20 20 20 |rtBits),| .. |
|000059d0| 20 20 20 20 20 20 20 20 | 20 26 6d 79 44 72 61 77 | | &myDraw|
|000059e0| 69 6e 67 50 6f 72 74 2d | 3e 70 6f 72 74 52 65 63 |ingPort-|>portRec|
|000059f0| 74 2c 20 26 6d 79 44 72 | 61 77 69 6e 67 50 6f 72 |t, &myDr|awingPor|
|00005a00| 74 2d 3e 70 6f 72 74 52 | 65 63 74 2c 20 73 72 63 |t->portR|ect, src|
|00005a10| 43 6f 70 79 2c 20 6e 69 | 6c 29 3b 0d 09 20 20 20 |Copy, ni|l);.. |
|00005a20| 20 55 6e 6c 6f 63 6b 50 | 69 78 65 6c 73 20 28 6d | UnlockP|ixels (m|
|00005a30| 79 44 72 61 77 69 6e 67 | 50 6f 72 74 2d 3e 70 6f |yDrawing|Port->po|
|00005a40| 72 74 50 69 78 4d 61 70 | 29 3b 0d 09 09 0d 09 20 |rtPixMap|);..... |
|00005a50| 20 7d 0d 20 20 20 20 20 | 65 6c 73 65 20 41 6c 65 | }. |else Ale|
|00005a60| 72 74 55 73 65 72 20 28 | 29 3b 0d 09 0d 20 20 20 |rtUser (|);... |
|00005a70| 20 69 66 20 28 6d 79 44 | 72 61 77 69 6e 67 50 6f | if (myD|rawingPo|
|00005a80| 72 74 20 21 3d 20 6e 69 | 6c 29 0d 20 20 20 09 20 |rt != ni|l). . |
|00005a90| 20 44 69 73 70 6f 73 65 | 47 57 6f 72 6c 64 20 28 | Dispose|GWorld (|
|00005aa0| 6d 79 44 72 61 77 69 6e | 67 50 6f 72 74 29 3b 0d |myDrawin|gPort);.|
|00005ab0| 0d 09 53 65 74 47 57 6f | 72 6c 64 20 28 63 75 72 |..SetGWo|rld (cur|
|00005ac0| 72 50 6f 72 74 2c 20 63 | 75 72 72 44 65 76 29 3b |rPort, c|urrDev);|
|00005ad0| 0d 09 0d 7d 20 20 20 20 | 2f 2f 20 65 6e 64 20 6f |...} |// end o|
|00005ae0| 66 20 63 6f 70 79 42 69 | 74 73 4d 79 47 72 61 70 |f copyBi|tsMyGrap|
|00005af0| 68 0d 0d 0d 0d 0d 0d 2f | 2f 2d 2d 2d 2d 2d 2d 20 |h....../|/------ |
|00005b00| 63 6f 6d 70 61 72 65 50 | 72 69 6e 74 52 65 63 6f |compareP|rintReco|
|00005b10| 72 64 73 20 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |rds ----|--------|
|00005b20| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00005b30| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00005b40| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 0d 2f 2f |--------|-----.//|
|00005b50| 0d 2f 2f 20 20 57 65 20 | 6e 65 65 64 20 74 6f 20 |.// We |need to |
|00005b60| 64 65 74 65 72 6d 69 6e | 65 20 69 66 20 74 68 65 |determin|e if the|
|00005b70| 20 70 72 69 6e 74 20 68 | 61 73 20 63 68 61 6e 67 | print h|as chang|
|00005b80| 65 64 2c 20 73 69 6e 63 | 65 20 74 68 65 20 6c 61 |ed, sinc|e the la|
|00005b90| 73 74 20 74 69 6d 65 20 | 77 65 0d 2f 2f 20 20 63 |st time |we.// c|
|00005ba0| 61 6c 6c 65 64 20 74 68 | 65 20 50 61 67 65 53 65 |alled th|e PageSe|
|00005bb0| 74 75 70 20 6f 72 20 50 | 72 69 6e 74 20 4a 6f 62 |tup or P|rint Job|
|00005bc0| 20 64 69 61 6c 6f 67 2e | 20 20 49 66 20 69 74 20 | dialog.| If it |
|00005bd0| 68 61 73 2c 20 77 65 20 | 77 61 6e 74 20 74 6f 20 |has, we |want to |
|00005be0| 75 70 64 61 74 65 20 74 | 68 65 20 70 72 69 6e 74 |update t|he print|
|00005bf0| 0d 2f 2f 09 72 65 63 6f | 72 64 20 77 69 74 68 20 |.//.reco|rd with |
|00005c00| 74 68 65 20 50 72 47 65 | 6e 65 72 61 6c 20 73 65 |the PrGe|neral se|
|00005c10| 6c 65 63 74 69 6f 6e 73 | 20 66 72 6f 6d 20 74 68 |lections| from th|
|00005c20| 65 20 50 72 47 65 6e 65 | 72 61 6c 20 6d 65 6e 75 |e PrGene|ral menu|
|00005c30| 2e 20 20 42 75 74 2c 20 | 62 65 66 6f 72 65 20 77 |. But, |before w|
|00005c40| 65 20 63 61 6c 6c 0d 2f | 2f 20 20 50 72 47 65 6e |e call./|/ PrGen|
|00005c50| 65 72 61 6c 20 74 6f 20 | 73 65 74 20 74 68 65 20 |eral to |set the |
|00005c60| 72 65 71 75 65 73 74 65 | 64 20 6f 70 63 6f 64 65 |requeste|d opcode|
|00005c70| 73 2c 20 77 65 20 77 69 | 6c 6c 20 63 61 6c 6c 20 |s, we wi|ll call |
|00005c80| 74 65 73 74 46 6f 72 50 | 72 47 65 6e 65 72 61 6c |testForP|rGeneral|
|00005c90| 20 74 6f 20 6d 61 6b 65 | 20 73 75 72 65 0d 2f 2f | to make| sure.//|
|00005ca0| 20 20 74 68 61 74 20 69 | 74 20 69 73 20 73 75 70 | that i|t is sup|
|00005cb0| 70 6f 72 74 65 64 20 62 | 79 20 74 68 65 20 22 6e |ported b|y the "n|
|00005cc0| 65 77 22 20 70 72 69 6e | 74 65 72 20 64 72 69 76 |ew" prin|ter driv|
|00005cd0| 65 72 2e 20 20 57 65 20 | 6f 6e 6c 79 20 77 6f 72 |er. We |only wor|
|00005ce0| 72 79 20 61 62 6f 75 74 | 20 74 68 65 20 53 65 74 |ry about| the Set|
|00005cf0| 52 73 6c 20 61 6e 64 0d | 2f 2f 20 20 44 72 61 66 |Rsl and.|// Draf|
|00005d00| 74 42 69 74 73 20 6f 70 | 63 6f 64 65 73 20 61 74 |tBits op|codes at|
|00005d10| 20 74 68 69 73 20 70 6f | 69 6e 74 2c 20 62 65 63 | this po|int, bec|
|00005d20| 61 75 73 65 20 74 68 65 | 79 20 65 66 66 65 63 74 |ause the|y effect|
|00005d30| 20 74 68 65 20 61 70 70 | 65 61 72 61 6e 63 65 20 | the app|earance |
|00005d40| 6f 66 20 74 68 65 20 50 | 61 67 65 53 65 74 75 70 |of the P|ageSetup|
|00005d50| 20 0d 2f 2f 20 20 61 6e | 64 20 50 72 69 6e 74 20 | .// an|d Print |
|00005d60| 4a 6f 62 2c 20 69 66 20 | 50 72 47 65 6e 65 72 61 |Job, if |PrGenera|
|00005d70| 6c 20 69 73 20 61 76 61 | 69 6c 61 62 6c 65 2e 0d |l is ava|ilable..|
|00005d80| 2f 2f 0d 0d 76 6f 69 64 | 20 63 6f 6d 70 61 72 65 |//..void| compare|
|00005d90| 50 72 69 6e 74 52 65 63 | 6f 72 64 73 20 28 29 0d |PrintRec|ords ().|
|00005da0| 7b 0d 09 54 48 50 72 69 | 6e 74 20 09 6c 6f 63 61 |{..THPri|nt .loca|
|00005db0| 6c 50 72 52 65 63 48 64 | 6c 3b 0d 09 73 68 6f 72 |lPrRecHd|l;..shor|
|00005dc0| 74 09 09 6c 61 74 65 73 | 74 44 72 69 76 65 72 56 |t..lates|tDriverV|
|00005dd0| 65 72 73 3b 0d 09 0d 0d | 09 2f 2f 20 43 72 65 61 |ers;....|.// Crea|
|00005de0| 74 65 20 61 20 6e 65 77 | 20 70 72 69 6e 74 20 72 |te a new| print r|
|00005df0| 65 63 6f 72 64 20 77 69 | 74 68 20 64 65 66 61 75 |ecord wi|th defau|
|00005e00| 6c 74 20 73 65 74 74 69 | 6e 67 73 0d 09 0d 09 6c |lt setti|ngs....l|
|00005e10| 6f 63 61 6c 50 72 52 65 | 63 48 64 6c 20 3d 20 28 |ocalPrRe|cHdl = (|
|00005e20| 54 48 50 72 69 6e 74 29 | 20 4e 65 77 48 61 6e 64 |THPrint)| NewHand|
|00005e30| 6c 65 28 73 69 7a 65 6f | 66 28 54 50 72 69 6e 74 |le(sizeo|f(TPrint|
|00005e40| 29 29 3b 0d 09 69 66 20 | 28 4d 65 6d 45 72 72 6f |));..if |(MemErro|
|00005e50| 72 28 29 20 3d 3d 20 6e | 6f 45 72 72 20 26 26 20 |r() == n|oErr && |
|00005e60| 6c 6f 63 61 6c 50 72 52 | 65 63 48 64 6c 20 21 3d |localPrR|ecHdl !=|
|00005e70| 20 6e 69 6c 29 0d 09 7b | 0d 09 09 50 72 69 6e 74 | nil)..{|...Print|
|00005e80| 44 65 66 61 75 6c 74 20 | 28 6c 6f 63 61 6c 50 72 |Default |(localPr|
|00005e90| 52 65 63 48 64 6c 29 3b | 0d 09 0d 09 09 6c 61 74 |RecHdl);|.....lat|
|00005ea0| 65 73 74 44 72 69 76 65 | 72 56 65 72 73 20 3d 20 |estDrive|rVers = |
|00005eb0| 50 72 44 72 76 72 56 65 | 72 73 20 28 29 3b 0d 09 |PrDrvrVe|rs ();..|
|00005ec0| 0d 09 09 2f 2f 20 20 54 | 68 69 73 20 69 73 20 61 |...// T|his is a|
|00005ed0| 6e 20 65 78 61 6d 70 6c | 65 20 6f 66 20 74 68 65 |n exampl|e of the|
|00005ee0| 20 72 69 67 68 74 20 70 | 6c 61 63 65 20 74 6f 20 | right p|lace to |
|00005ef0| 75 73 65 20 77 44 65 76 | 2e 20 57 65 20 61 72 65 |use wDev|. We are|
|00005f00| 20 6f 6e 6c 79 20 75 73 | 69 6e 67 20 77 44 65 76 | only us|ing wDev|
|00005f10| 20 74 6f 20 0d 09 09 2f | 2f 20 20 64 65 74 65 72 | to .../|/ deter|
|00005f20| 6d 69 6e 65 2c 20 69 66 | 20 74 68 65 20 70 72 69 |mine, if| the pri|
|00005f30| 6e 74 20 72 65 63 6f 72 | 64 73 20 61 72 65 20 74 |nt recor|ds are t|
|00005f40| 68 65 20 73 61 6d 65 20 | 74 79 70 65 2e 20 4e 4f |he same |type. NO|
|00005f50| 54 20 74 6f 20 63 68 65 | 63 6b 20 66 6f 72 20 73 |T to che|ck for s|
|00005f60| 70 65 63 69 66 69 63 0d | 09 09 2f 2f 20 20 66 75 |pecific.|..// fu|
|00005f70| 6e 63 74 69 6f 6e 61 6c | 69 74 79 20 77 68 69 63 |nctional|ity whic|
|00005f80| 68 20 77 6f 75 6c 64 20 | 62 65 20 61 20 62 61 64 |h would |be a bad|
|00005f90| 20 69 64 65 61 20 66 6f | 72 20 63 6f 6d 70 61 74 | idea fo|r compat|
|00005fa0| 69 62 69 6c 69 74 79 20 | 77 69 74 68 20 75 6e 6b |ibility |with unk|
|00005fb0| 6e 6f 77 6e 20 70 72 69 | 6e 74 65 72 73 2e 0d 09 |nown pri|nters...|
|00005fc0| 09 0d 09 09 69 66 20 28 | 50 72 45 72 72 6f 72 20 |....if (|PrError |
|00005fd0| 28 29 20 3d 3d 20 6e 6f | 45 72 72 29 0d 09 09 20 |() == no|Err)... |
|00005fe0| 7b 0d 09 09 20 20 69 66 | 20 28 28 28 28 2a 2a 67 |{... if| ((((**g|
|00005ff0| 50 72 52 65 63 48 64 6c | 29 2e 70 72 53 74 6c 2e |PrRecHdl|).prStl.|
|00006000| 77 44 65 76 29 20 3e 3e | 20 38 29 20 21 3d 20 28 |wDev) >>| 8) != (|
|00006010| 28 28 2a 2a 6c 6f 63 61 | 6c 50 72 52 65 63 48 64 |((**loca|lPrRecHd|
|00006020| 6c 29 2e 70 72 53 74 6c | 2e 77 44 65 76 29 20 3e |l).prStl|.wDev) >|
|00006030| 3e 20 38 29 0d 09 09 09 | 20 20 20 7c 7c 20 28 6c |> 8)....| || (l|
|00006040| 61 74 65 73 74 44 72 69 | 76 65 72 56 65 72 73 20 |atestDri|verVers |
|00006050| 21 3d 20 67 4f 72 69 67 | 69 6e 61 6c 44 72 69 76 |!= gOrig|inalDriv|
|00006060| 65 72 56 65 72 73 29 29 | 0d 09 09 20 20 20 7b 20 |erVers))|... { |
|00006070| 0d 09 09 09 20 2f 2f 20 | 20 53 65 74 20 74 68 65 |.... // | Set the|
|00006080| 20 70 72 69 6e 74 20 72 | 65 63 6f 72 64 20 74 6f | print r|ecord to|
|00006090| 20 64 65 66 61 75 6c 74 | 20 73 65 74 74 69 6e 67 | default| setting|
|000060a0| 73 20 66 6f 72 20 74 68 | 65 20 22 6e 65 77 22 20 |s for th|e "new" |
|000060b0| 70 72 69 6e 74 65 72 2e | 2e 2e 0d 09 0d 09 09 09 |printer.|........|
|000060c0| 20 50 72 69 6e 74 44 65 | 66 61 75 6c 74 20 28 67 | PrintDe|fault (g|
|000060d0| 50 72 52 65 63 48 64 6c | 29 3b 0d 09 09 09 0d 09 |PrRecHdl|);......|
|000060e0| 09 09 20 2f 2f 20 20 52 | 65 73 65 74 20 74 68 65 |.. // R|eset the|
|000060f0| 20 76 61 6c 75 65 20 6f | 66 20 67 4f 72 69 67 69 | value o|f gOrigi|
|00006100| 6e 61 6c 44 72 69 76 65 | 72 56 65 72 73 0d 09 0d |nalDrive|rVers...|
|00006110| 09 09 09 20 67 4f 72 69 | 67 69 6e 61 6c 44 72 69 |... gOri|ginalDri|
|00006120| 76 65 72 56 65 72 73 20 | 3d 20 6c 61 74 65 73 74 |verVers |= latest|
|00006130| 44 72 69 76 65 72 56 65 | 72 73 3b 0d 09 0d 09 0d |DriverVe|rs;.....|
|00006140| 09 09 09 20 2f 2f 20 20 | 52 65 73 65 74 20 67 4d |... // |Reset gM|
|00006150| 61 78 44 50 49 20 74 6f | 20 65 6e 61 62 6c 65 20 |axDPI to| enable |
|00006160| 74 68 65 20 6c 6f 6f 70 | 20 69 6e 20 73 65 74 4d |the loop| in setM|
|00006170| 61 78 52 65 73 6f 6c 75 | 74 69 6f 6e 20 74 6f 20 |axResolu|tion to |
|00006180| 66 69 6e 64 20 74 68 65 | 20 63 6f 72 72 65 63 74 |find the| correct|
|00006190| 20 0d 09 09 09 20 2f 2f | 20 20 6d 61 78 69 6d 75 | .... //| maximu|
|000061a0| 6d 20 72 65 73 6f 6c 75 | 74 69 6f 6e 0d 09 0d 09 |m resolu|tion....|
|000061b0| 09 09 20 67 4d 61 78 44 | 50 49 20 3d 20 30 3b 0d |.. gMaxD|PI = 0;.|
|000061c0| 09 09 09 20 0d 09 09 09 | 20 0d 09 09 09 20 2f 2f |... ....| .... //|
|000061d0| 20 20 52 65 73 65 74 20 | 61 6c 6c 20 6f 66 20 74 | Reset |all of t|
|000061e0| 68 65 20 6f 70 63 6f 64 | 65 20 69 6d 70 6c 65 6d |he opcod|e implem|
|000061f0| 65 6e 74 61 74 69 6f 6e | 20 66 6c 61 67 73 2e 20 |entation| flags. |
|00006200| 20 57 65 20 6e 6f 77 20 | 68 61 76 65 20 61 20 6e | We now |have a n|
|00006210| 65 77 20 70 72 69 6e 74 | 65 72 0d 09 09 09 20 2f |ew print|er.... /|
|00006220| 2f 20 20 64 72 69 76 65 | 72 2c 20 74 68 65 72 65 |/ drive|r, there|
|00006230| 66 6f 72 65 20 77 65 20 | 6e 65 65 64 20 74 6f 20 |fore we |need to |
|00006240| 64 65 74 65 72 6d 69 6e | 65 20 77 68 69 63 68 20 |determin|e which |
|00006250| 6f 70 63 6f 64 65 73 20 | 61 72 65 20 73 75 70 70 |opcodes |are supp|
|00006260| 6f 72 74 65 64 2e 0d 09 | 09 09 20 0d 09 09 09 20 |orted...|.. .... |
|00006270| 67 4c 61 6e 64 73 63 61 | 70 65 4f 70 49 6d 70 6c |gLandsca|peOpImpl|
|00006280| 20 3d 20 74 72 75 65 3b | 0d 09 09 09 20 67 44 72 | = true;|.... gDr|
|00006290| 61 66 74 42 69 74 73 4f | 70 49 6d 70 6c 20 3d 20 |aftBitsO|pImpl = |
|000062a0| 74 72 75 65 3b 0d 09 09 | 09 20 67 53 65 74 52 73 |true;...|. gSetRs|
|000062b0| 6c 4f 70 49 6d 70 6c 20 | 3d 20 74 72 75 65 3b 0d |lOpImpl |= true;.|
|000062c0| 09 09 09 20 0d 09 09 09 | 20 0d 09 09 09 20 2f 2f |... ....| .... //|
|000062d0| 20 54 65 73 74 20 74 6f | 20 64 65 74 65 72 6d 69 | Test to| determi|
|000062e0| 6e 65 2c 20 69 66 20 74 | 68 65 20 22 6e 65 77 22 |ne, if t|he "new"|
|000062f0| 20 70 72 69 6e 74 65 72 | 20 64 72 69 76 65 72 20 | printer| driver |
|00006300| 73 75 70 70 6f 72 74 73 | 20 50 72 47 65 6e 65 72 |supports| PrGener|
|00006310| 61 6c 20 62 65 66 6f 72 | 65 0d 09 09 09 20 2f 2f |al befor|e.... //|
|00006320| 20 75 70 64 61 74 69 6e | 67 20 74 68 65 20 70 72 | updatin|g the pr|
|00006330| 69 6e 74 20 72 65 63 6f | 72 64 20 77 69 74 68 20 |int reco|rd with |
|00006340| 74 68 65 20 72 65 71 75 | 65 73 74 65 64 20 50 72 |the requ|ested Pr|
|00006350| 47 65 6e 65 72 61 6c 20 | 6f 70 63 6f 64 65 73 2e |General |opcodes.|
|00006360| 2e 2e 0d 09 0d 09 09 09 | 20 69 66 20 28 50 72 45 |........| if (PrE|
|00006370| 72 72 6f 72 20 28 29 20 | 3d 3d 20 6e 6f 45 72 72 |rror () |== noErr|
|00006380| 29 0d 09 09 09 09 67 50 | 72 47 65 6e 65 72 61 6c |).....gP|rGeneral|
|00006390| 4c 69 76 65 73 20 3d 20 | 74 65 73 74 46 6f 72 50 |Lives = |testForP|
|000063a0| 72 47 65 6e 65 72 61 6c | 20 28 29 3b 0d 09 09 09 |rGeneral| ();....|
|000063b0| 20 65 6c 73 65 20 41 6c | 65 72 74 55 73 65 72 20 | else Al|ertUser |
|000063c0| 28 29 3b 20 20 0d 09 0d | 09 09 09 20 0d 09 09 09 |(); ...|... ....|
|000063d0| 20 2f 2f 20 43 61 6c 6c | 20 74 68 65 20 61 70 70 | // Call| the app|
|000063e0| 72 6f 70 72 69 61 74 65 | 20 50 72 47 65 6e 65 72 |ropriate| PrGener|
|000063f0| 61 6c 20 6f 70 63 6f 64 | 65 73 2c 20 64 65 74 65 |al opcod|es, dete|
+--------+-------------------------+-------------------------+--------+--------+
Only 25.0 KB of data is shown above.